Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 18th, 2005, 10:56 PM
mirandacascade@yahoo.com
Guest
 
Posts: n/a
Default progress bar controls in status.py

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\pythonwin\pywin\dialogs\

folder.

The only modification I made to status.py was to the demo() method
where I added the type argument and then called either
StatusProgressDialog or ThreadedStatusProgressDialog. The modified
demo() method looks like this:

def demo(type):
if type == "threaded":
d = ThreadedStatusProgressDialog("A Demo", "Doing
something...")
else:
d = StatusProgressDialog("A Demo", "Doing something...")

import win32api
for i in range(100):
if i == 50:
d.SetText("Getting there...")
if i==90:
d.SetText("Nearly 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('threaded')[/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 ThreadedStatusProgressDialog to emulate
the behavior of StatusProgressDialog, what changes must I make to
status.py to accomplish that? (assume that I want
ThreadedStatusProgressDialog to remain threaded, i.e. I'm not looking
for an answer along the lines of "if you want the behavior of
ThreadedStatusProgressDialog to emulate the behavior of
StatusProgressDialog, then have it call StatusProgressDialog.")
2) Can you offer any guidelines or rules of thumb regarding when one
would wish to use ThreadedStatusProgressDialog vs using
StatusProgressDialog?

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles