Progress bar value is not updating in tk buddy dating
During that time, I would like for the GUI to continue to show signs oflife.Ifigured out that if I run update_idletasks on that Message Bar, then the Message Bar will update the display as I update the message.update_idletasks gives it a chance to handle other events. Typically a long-running task should be run as a separate background thread (or even a separate process).The difficulty is that background threads cannot safely interact with GUI elements, so how does the thread communicate?I'm confused about how to use the update_idletasks method.In my program, I have a handler for a button in which execution will linger.I tried running it on the root window, even though the information you provided indicated that it doesn't matter what class owns the method -- and my experience certainly does not contradict that statement. The only technique I have found that permits the main window to update is to run most of the handler in a separate thread. First, in response to your questions: (1) I am on Linux (there are other platforms?The problem I am having with that approach is that the Message Bar then flashes in an annoying way (the background seems to go to white at every update and then gets redrawn to gray -- which happens only when the while loop is in its own thread). ); (2) I am using Python 2.3; (3) it is difficult to extract a piece of the code, but I will attempt to describe more clearly what I am doing. In the handler I use popen3 to launch a program that takes a long time to execute.
But be careful: wait_visibility processes events, unlike update_idletasks that does just a GUI refresh.HTH -- - Eric Brunel I'm confused about how to use the update_idletasks method.There is apparently no simple way of updating the display of newly created toplevel's on Windows without returning full control to the GUI (at least with tk/Tkinter) I never saw the problem you describe (some windows refreshing, some not), but I mainly develop on Linux, which may show a different behaviour than the platform you're working on (which BTW you don't mention...). However, that is not the behavior that I am seeing.The problem I am having with that approach is that the Message Bar then flashes in an annoying way (the background seems to go to white at every update and then gets redrawn to gray -- which happens only when the while loop is in its own thread). I've been using a Tkinter filehandler for similar tasks and didn't have the problems you describe.Here's a pseudo-code snippet to illustrate what I did: from Tkinter import * import os, fcntl, popen2 def button_callback(self, event): #the function that's bound to the button #dialog window with progress bar: = Progress Window.