Textvariable display in label (GUI design)
eric.brunel at pragmadev.nospam.com
Mon Aug 16 17:32:51 CEST 2010
<993d9560-564d-47f0-b2db-6f0c6404ae81 at g6g2000pro.googlegroups.com>,
Jah_Alarm <jah.alarm at gmail.com> wrote:
> pls help me out with the following issue: I wrote a function that uses
> a for loop that changes a value of a certain variable each iteration.
> What I want is by clicking a button in GUI (with the command bound to
> this function) this value each iteration is displayed in a textbox
> (label). So far only one (starting value) is displayed.
First, with posts like this, you're highly unlikely to get any useful
answer: please strip down your code to the smallest part that displays
the problem, post this code here, explaining what you're expecting and
what you're getting. Otherwise, people just won't know what you're
talking about unless they have a crystal ball
Now using my own crystal ball: if you don't return the control to the
GUI each time your variable is increased, the GUI won't get a chance to
update itself. Since you seem to use Tkinter (another wild guess), you
probably need a call to the update_idletasks method on any Tkinter
widget each time you change your TextVariable.
- Eric -
More information about the Python-list