Placing entry widgets on a canvas in Tkinter

  • Thread starter =?ISO-8859-1?Q?Mickel_Gr=F6nroos?=
  • Start date
?

=?ISO-8859-1?Q?Mickel_Gr=F6nroos?=

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top