Hi again, let me start off by saying that my code does what I want it to,
it's just done in a terribly hackish way, and I'm wondering if there's a
better way to do it.

I've got a Tkinter window, and when you click a button (the 'run' button),
it opens a new window.  When the new window opens, it starts running events
in a while loop, and there's a 'stop' button on the window.  The stop button
just turns the 'while' condition variable to 0, so the loop ends.  Here's a
quick sketch of how I got it to work:

...
loop = 1
...
(create a button that sets loop to 0)
...
top.update()
...
while loop:
  top.update()
  ...do stuff...
  top.update()

This works, but I feel like there's got to be a better way to be doing
this.  I can get rid of  the first top.update(), and one of the updates in
the loop, but this configuration seems to be the most responsive.  And using
update_idletasks() doesn't seem to work, at all.

Anyone have an idea?

-Adam
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to