Setting allowed size of text object on canvas in Tkinter

Mickel Grönroos mickel at csc.fi
Tue Jun 10 03:18:45 EDT 2003


Hi everybody!

How do I force a text object to be of a required size on a canvas in
Tkinter?

I have a Tkinter.Canvas widget onto which I have drawn a rectangle with
create_rectangle(). Inside this rectangle I want to put a text object, but
also make sure that the text does not overflow the rectangle's borders
(rather, the overflow should be cut off from view). Currently I'm trying
to do this with create_text, but that only accepts coordinates for a point
and not for the bounding box. Any ideas?

Cheers,

/Mickel G.

--
Mickel Grönroos, application specialist, linguistics, Research support, CSC
PL 405 (Tekniikantie 15 a D), 02101 Espoo, Finland, phone +358-9-4572237
CSC is the Finnish IT center for science, www.csc.fi






More information about the Python-list mailing list