Hi,
I have an application which uses wx.ProgressDialog . The code is similar to the attached example. When user clicks “progress” button task thread starts and progress dialog should be updated. In wx 2.8.10.1 it works correctly:
the application when starts, progress dialog is hidden
worker thread sends notifications to the progress dialog
progress dialog receives these notifications and updates displayed message and progress
On wx Python 2.9.2.1 however progress dialog doesn’t hide at the beginning and what is more important notifications are not received by the progress dialog.
Is this an error in wx 2.9 or I am doing something wrong here?
I'm not sure why the hide is not working. Which platform? But in either case I've always seen the progress dialog created just when needed. Is there some reason you think you need to keep it around?
The main problem is that you are blocking in __onProgress instead of returning to the event loop, so events are not able to be delivered. If it worked in 2.8 then there is probably a yield happening in the wx code someplace, or in some other part of your code.
Instead of blocking in __onProgress you can just let it return and then update the progress dialog (or close it when done) in __update.
···
On 8/16/11 8:10 AM, uhz wrote:
Hi,
I have an application which uses wx.ProgressDialog . The code is similar
to the attached example. When user clicks "progress" button task thread
starts and progress dialog should be updated. In wx 2.8.10.1 it works
correctly:
* the application when starts, progress dialog is hidden
* worker thread sends notifications to the progress dialog
* progress dialog receives these notifications and updates displayed
message and progress
On wx Python 2.9.2.1 however progress dialog doesn't hide at the
beginning and what is more important notifications are not received by
the progress dialog.
Is this an error in wx 2.9 or I am doing something wrong here?
I have a long running task during which I show the progress dialog - a kind of long import. Additionally I have to ask user for some decisions from time to time - I would like to show a modal window on top of the progress dialog with a question to the user. Unfortunatelly it seems impossible in wx 2.9. I cannot do anything with the progress dialog - cannot deactivate it, hide or even force my question window to be on top. I don’t want to destroy the progress dialog because the time left would reset. Do you have any idea of how I could do this with progressdialog from wx 2.9?
In 2.9 a new native dialog is being used for the wx.ProgressDialog on new enough Windows systems, I expect that it is the problem. You can get the old non-native progress dialog class by using wx.GenericProgressDialog instead.
···
On 10/13/11 7:48 AM, uhz wrote:
Platform - windows Vista.
I have a long running task during which I show the progress dialog - a
kind of long import. Additionally I have to ask user for some decisions
from time to time - I would like to show a modal window on top of the
progress dialog with a question to the user. Unfortunatelly it seems
impossible in wx 2.9. I cannot do anything with the progress dialog -
cannot deactivate it, hide or even force my question window to be on
top. I don't want to destroy the progress dialog because the time left
would reset. Do you have any idea of how I could do this with
progressdialog from wx 2.9?