O/S - Windows XP Home with Service Pack 2
Vsn of Python: 2.4 (from ActiveState)
This question is with regard to the progress bar controls that are in
the file status.py. On my workstation, status.py is located in the:
c:\python24\lib \site-packages\python win\pywin\dialo gs\
folder.
The only modification I made to status.py was to the demo() method
where I added the type argument and then called either
StatusProgressD ialog or ThreadedStatusP rogressDialog. The modified
demo() method looks like this:
def demo(type):
if type == "threaded":
d = ThreadedStatusP rogressDialog(" A Demo", "Doing
something...")
else:
d = StatusProgressD ialog("A Demo", "Doing something...")
import win32api
for i in range(100):
if i == 50:
d.SetText("Gett ing there...")
if i==90:
d.SetText("Near ly done...")
win32api.Sleep( 20)
d.Tick()
d.Close()
Using the interactive window of PythonWin, when I do the following:[color=blue][color=green][color=darkred]
>>> import status
>>> status.demo('a' )[/color][/color][/color]
the results are:
- a progress bar with title 'A Demo' appears
- ticks appear within the progress bar
- the message changes from 'Doing something' to 'Getting there...' to
'Nearly done...'
- the progress bar no longer appears
Using the interactive window of PythonWin, when I do the following:[color=blue][color=green][color=darkred]
>>> import status
>>> status.demo('th readed')[/color][/color][/color]
the results are:
- the cursor position stays immediately to the right of the ')'
character
- nothing appears on the screen
- about 10 seconds later the >>> appears, a progress bar control
appears with the title 'A Demo' and text 'Doing something'
- the progress bar remains visible until I close it by clicking on the
X in the top right corner
My questions are:
1) If I want the behavior of ThreadedStatusP rogressDialog to emulate
the behavior of StatusProgressD ialog, what changes must I make to
status.py to accomplish that? (assume that I want
ThreadedStatusP rogressDialog to remain threaded, i.e. I'm not looking
for an answer along the lines of "if you want the behavior of
ThreadedStatusP rogressDialog to emulate the behavior of
StatusProgressD ialog, then have it call StatusProgressD ialog.")
2) Can you offer any guidelines or rules of thumb regarding when one
would wish to use ThreadedStatusP rogressDialog vs using
StatusProgressD ialog?
Vsn of Python: 2.4 (from ActiveState)
This question is with regard to the progress bar controls that are in
the file status.py. On my workstation, status.py is located in the:
c:\python24\lib \site-packages\python win\pywin\dialo gs\
folder.
The only modification I made to status.py was to the demo() method
where I added the type argument and then called either
StatusProgressD ialog or ThreadedStatusP rogressDialog. The modified
demo() method looks like this:
def demo(type):
if type == "threaded":
d = ThreadedStatusP rogressDialog(" A Demo", "Doing
something...")
else:
d = StatusProgressD ialog("A Demo", "Doing something...")
import win32api
for i in range(100):
if i == 50:
d.SetText("Gett ing there...")
if i==90:
d.SetText("Near ly done...")
win32api.Sleep( 20)
d.Tick()
d.Close()
Using the interactive window of PythonWin, when I do the following:[color=blue][color=green][color=darkred]
>>> import status
>>> status.demo('a' )[/color][/color][/color]
the results are:
- a progress bar with title 'A Demo' appears
- ticks appear within the progress bar
- the message changes from 'Doing something' to 'Getting there...' to
'Nearly done...'
- the progress bar no longer appears
Using the interactive window of PythonWin, when I do the following:[color=blue][color=green][color=darkred]
>>> import status
>>> status.demo('th readed')[/color][/color][/color]
the results are:
- the cursor position stays immediately to the right of the ')'
character
- nothing appears on the screen
- about 10 seconds later the >>> appears, a progress bar control
appears with the title 'A Demo' and text 'Doing something'
- the progress bar remains visible until I close it by clicking on the
X in the top right corner
My questions are:
1) If I want the behavior of ThreadedStatusP rogressDialog to emulate
the behavior of StatusProgressD ialog, what changes must I make to
status.py to accomplish that? (assume that I want
ThreadedStatusP rogressDialog to remain threaded, i.e. I'm not looking
for an answer along the lines of "if you want the behavior of
ThreadedStatusP rogressDialog to emulate the behavior of
StatusProgressD ialog, then have it call StatusProgressD ialog.")
2) Can you offer any guidelines or rules of thumb regarding when one
would wish to use ThreadedStatusP rogressDialog vs using
StatusProgressD ialog?