470,585 Members | 1,639 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,585 developers. It's quick & easy.

Placing entry widgets on a canvas in Tkinter


I'm trying to put an Tkinter.Entry of fixed size onto a specific location
on a canvas using the place manager. The idea is that one can double-click
a rectangle object on a canvas to get an entry field of the same size
as the rectangle placed exactly over the rectangle thus creating
the effect that the rectangle has entered "input mode". When clicking
return in the entry field, the value is fed back to a text object within
the rectangle object on the canvas.

Well, this works fine and well until the canvas is scrolled of one reason
or another. When that happens, the entry naturally does not follow the
canvas. Is there a way to lock a widget which is "placed" onto a canvas to
the canvas so that it follows the canvas as it scrolls or is rescaled? Or
do I have to implement a brand new set() method for the
scrollbar-canvas-relationship that not only scrolls the canvas, but also
moves the entry widget accordingly?

Or put it another way, does anybody have a better idea of how I can get a
fixed-size entry hovering over a rectangle object on a canvas than to use
the place geometry manager for placing an entry widget in that exact
location? (Don't tell me to just use text objects on the canvas as those
cannot be really fixed in width *and* height.)

Hope you can help.



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

Jul 18 '05 #1
0 1983

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Otto Krüse | last post: by
1 post views Thread by Elaine Jackson | last post: by
2 posts views Thread by Adonis | last post: by
3 posts views Thread by Tuvas | last post: by
2 posts views Thread by Martyn Quick | last post: by
reply views Thread by nish88 | last post: by
reply views Thread by Leonhard Vogt | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.