Tkinter from Vis. BASIC

  • Thread starter Terrance N. Phillip
  • Start date
T

Terrance N. Phillip

In VB, an easy way I indicate progress is something like
do while <some process is not met>
lblNotify.foreground = randomcolor
lblNotify.refresh <-----------
<sleep>
loop

I want to do the same thing in Python/Tkinter:

# Wait for network to recognize the workstation:
while os.system("slist") != 0:
self.notify["fg"] = randcolor()
# how do I refresh label l3 at this point?
time.sleep(3)

I've tried self.notify.grid() (I'm using the grid geometry manager
throughout), but that didn't work, and there is no redraw() or refresh()
method that I can see.
 
J

jmdeschamps

Terrance said:
In VB, an easy way I indicate progress is something like
do while <some process is not met>
lblNotify.foreground = randomcolor
lblNotify.refresh <-----------
<sleep>
loop

I want to do the same thing in Python/Tkinter:

# Wait for network to recognize the workstation:
while os.system("slist") != 0:
self.notify["fg"] = randcolor()
# how do I refresh label l3 at this point?
time.sleep(3)

I've tried self.notify.grid() (I'm using the grid geometry manager
throughout), but that didn't work, and there is no redraw() or refresh()
method that I can see.

I know of an update_idletask() method, look it up in the tkinter doc to
see if that's what you need!
 
T

Terrance N. Phillip

I want to do the same thing in Python/Tkinter:

# Wait for network to recognize the workstation:
while os.system("slist") != 0:
self.notify["fg"] = randcolor()
# how do I refresh label l3 at this point?
time.sleep(3)
I know of an update_idletask() method, look it up in the tkinter doc to
see if that's what you need!
Thanks. I did a dir(label_object) and saw update() and
update_idletasks(). updeate() seems to do the trick.
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top