progress bar controls in status.py

Discussion in 'Python' started by mirandacascade@yahoo.com, Feb 23, 2005.

  1. Guest

    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?
    , Feb 23, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    0
    Views:
    3,529
  2. John Hann
    Replies:
    0
    Views:
    6,048
    John Hann
    Aug 21, 2004
  3. Charlie Zhang
    Replies:
    3
    Views:
    1,244
    Paul Lutus
    Aug 16, 2004
  4. Matt
    Replies:
    9
    Views:
    70,775
  5. Matt
    Replies:
    9
    Views:
    529
    kaeli
    Aug 23, 2004
Loading...

Share This Page