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) ?
10x,
Roy.
···
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
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
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):
- does this not mean that i runs from 0 to 11? As 11 is less than the
maximum you set (12) does that in turn mean that the progress bar will not
reach its upper limit? Would that matter?
···
"ROY ZINN" <royzinn@hotmail.com> wrote:
--
Jeremy C B Nicoll - my opinions are my own.