Placing entry widgets on a canvas in Tkinter

Discussion in 'Python' started by =?ISO-8859-1?Q?Mickel_Gr=F6nroos?=, Jun 30, 2003.

  1. 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
     
    =?ISO-8859-1?Q?Mickel_Gr=F6nroos?=, Jun 30, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?ISO-8859-1?Q?Mickel_Gr=F6nroos?=

    Re: Placing entry widgets on a canvas in Tkinter

    =?ISO-8859-1?Q?Mickel_Gr=F6nroos?=, Jun 30, 2003, in forum: Python
    Replies:
    0
    Views:
    1,043
    =?ISO-8859-1?Q?Mickel_Gr=F6nroos?=
    Jun 30, 2003
  2. Atul
    Replies:
    2
    Views:
    385
  3. Chris Hare
    Replies:
    2
    Views:
    555
    Chris Hare
    Aug 16, 2010
  4. David Bailey

    Placing Sets of Ruby/Tk Widgets

    David Bailey, Apr 2, 2006, in forum: Ruby
    Replies:
    3
    Views:
    239
    David Bailey
    Apr 3, 2006
  5. Arnaud Delobelle

    Tkinter bug in Entry widgets on OS X

    Arnaud Delobelle, Aug 31, 2012, in forum: Python
    Replies:
    7
    Views:
    287
    Arnaud Delobelle
    Sep 1, 2012
Loading...

Share This Page