[wxPython-users] wx.ProgressDialog problem

Werner F. Bruhin werner.bruhin at free.fr
Sun Jun 10 06:13:15 PDT 2007


Hi Roy,

ROY ZINN wrote:
> Hi All,
>
> I'm trying to use the progress dialog, but, the progress bar can not 
> be closed. itried the autohide method and Destroy() but it gets stuck
>
> this is the part of the code where i call it:
>
> def Progress_Bar():
>    app = wx.PySimpleApp(redirect=False)
>    dialog = wx.ProgressDialog ( 'Progress', 'Entering Sleep Mode', 
> maximum = 12, style = wx.PD_ELAPSED_TIME |wx.PD_REMAINING_TIME | 
> wx.PD_SMOOTH)
>    for i in range(12):
>        time.sleep(5)
>        dialog.Update ( i, 'Entering Sleep Mode')
>    dialog.Destroy()
>
> Is there a difference if i call the progress dialog from within a a 
> frame ?
> Is it a probel to call the above function more than once (the 
> app=wx.PySimpleApp(redirect=False is being created on each call) ?
This is probably your problem, why not just put PySimpleApp outside this 
function.

Creating a little module which just runs the above once works as expected.

Werner




More information about the wxpython-users mailing list