Python TKinter connect variable to entry widget

Posted by Sano98 on Stack Overflow See other posts from Stack Overflow or by Sano98
Published on 2010-03-26T14:38:26Z Indexed on 2010/03/26 15:43 UTC
Read the original article Hit count: 433

Filed under:
|
|
|
|

Hi everyone,

I'm trying to associate a variable with a Tkinter entry widget, in a way that:

  1. Whenever I change the value (the "content") of the entry, mainly by typing something into it, the variable automatically gets assigned the value of what I've typed. Without me having to push a button "Update value " or something like that first.
  2. Whenever the variable gets changed (by some other part of the programm), I want the entry value displayed to be adjusted automatically. I believe that this could work via the textvariable.

I read the example on http://effbot.org/tkinterbook/entry.htm, but it is not exactly helping me for what I have in mind. I have a feeling that there is a way of ensuring the first condition with using entry's "validate". Any ideas?

Thank you for your input!
Sano

© Stack Overflow or respective owner

Related posts about python

Related posts about tkinter