By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,310 Members | 1,430 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,310 IT Pros & Developers. It's quick & easy.

Placing entry widgets on a canvas in Tkinter

P: n/a
Hi,

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.

Cheers,

/Mickel

--
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
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.