Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > progress bar controls in status.py

Reply
Thread Tools

progress bar controls in status.py

 
 
mirandacascade@yahoo.com
Guest
Posts: n/a
 
      02-23-2005
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:
>>> import status
>>> status.demo('a')

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:
>>> import status
>>> status.demo('threaded')

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?

 
Reply With Quote
 
 
 
Reply

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
disable title bar, status bar, and address bar of a window Matt HTML 9 08-23-2004 07:49 PM
Re: disable title bar, status bar, and address bar of a browser window John Hann ASP .Net 0 08-21-2004 05:07 AM
disable title bar, status bar, and address bar of a browser window Matt ASP .Net 0 08-21-2004 03:50 AM
Progress bar to show the progress of a task Charlie Zhang Java 3 08-16-2004 05:53 PM
progress bar or guage bar Rob ASP General 6 07-12-2003 09:46 AM



Advertisments