[wxPython] Updating the status bar?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve Lamb

    [wxPython] Updating the status bar?

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Ok, this one I did try before coming here... :)

    I am trying to report the status of what is going on to the status
    bar of the main window of my wxPython app. I know I'm on the right
    track with SetStatusText() but it doesn't always alter the text. What
    the program is doing is taking a filename and passing it through two
    different external programs. One of them is taking a little bit of time
    to process the file (sa-learn) so the user needs to know what is going
    on. Right now I have the call to update the status bar preceding the
    external call like so:

    self.MainStatus .SetStatusText( 'Reporting message as spam.',0)
    code = os.system("%s '%s'" % (vars.razor_spa m, filepath))

    The status bar is not being updated. I know it works because other
    calls I have to the same method work fine. Is there some call I need to
    make to refresh the window or at least the status bar?

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.2 (GNU/Linux)

    iD8DBQE/Nxw5el/srYtumcURAkUaAK CsZep0u8rjIalqX YJ4+8BbeqmdVgCf RbYx
    3vIlOU4xsEXlLQI 5+3Q74Dc=
    =4EQS
    -----END PGP SIGNATURE-----

    --
    Steve C. Lamb | I'm your priest, I'm your shrink, I'm your
    PGP Key: 8B6E99C5 | main connection to the switchboard of souls.
    | -- Lenny Nero - Strange Days
    -------------------------------+---------------------------------------------
  • Rob Williscroft

    #2
    Re: [wxPython] Updating the status bar?

    Steve Lamb wrote in news:slrnbje71n .k27.grey@teleu te.dmiyu.org:
    [color=blue]
    > Ok, this one I did try before coming here... :)
    >
    > I am trying to report the status of what is going on to the status
    > bar of the main window of my wxPython app. I know I'm on the right
    > track with SetStatusText() but it doesn't always alter the text. What
    > the program is doing is taking a filename and passing it through two
    > different external programs. One of them is taking a little bit of
    > time to process the file (sa-learn) so the user needs to know what is
    > going on. Right now I have the call to update the status bar
    > preceding the external call like so:
    >
    > self.MainStatus .SetStatusText( 'Reporting message as
    > spam.',0) code = os.system("%s '%s'" % (vars.razor_spa m,
    > filepath))
    >
    > The status bar is not being updated. I know it works because
    > other calls I have to the same method work fine. Is there some
    > call I need to make to refresh the window or at least the status
    > bar?[/color]

    From the wxWindows help file:

    wxWindow::Updat e
    virtual void Update()

    Calling this method immediately repaints the invalidated area of the
    window while this would usually only happen when the flow of control
    returns to the event loop. Notice that this function doesn't refresh the
    window and does nothing if the window hadn't been already repainted. Use
    Refresh first if you want to immediately redraw the window
    unconditionally .

    So I would guess at:

    self.MainStatus .Refresh()
    self.MainStatus .Update()

    HTH

    Rob.
    --

    Comment

    • Cliff Wells

      #3
      Re: [wxPython] Updating the status bar?

      On Fri, 2003-08-15 at 13:06, Steve Lamb wrote:[color=blue]
      > -----BEGIN PGP SIGNED MESSAGE-----
      > Hash: SHA1
      >
      > On 11 Aug 2003 05:32:10 GMT, Rob Williscroft <rtw@freenet.RE MOVE.co.uk> wrote:[color=green]
      > > So I would guess at:[/color]
      >[color=green]
      > > self.MainStatus .Refresh()
      > > self.MainStatus .Update()[/color]
      >
      > Finally got around to trying this and no dice. Still does not
      > update the status bar at all. :/[/color]

      Try adding a wxYield() after the Update(). The Refresh() probably isn't
      necessary.

      Regards,

      --
      Cliff Wells, Software Engineer
      Logiplex Corporation (www.logiplex.net)
      (503) 978-6726 (800) 735-0555


      Comment

      • Steve Lamb

        #4
        Re: [wxPython] Updating the status bar?

        -----BEGIN PGP SIGNED MESSAGE-----
        Hash: SHA1

        On Fri, 15 Aug 2003 14:09:50 -0700, Cliff Wells <logiplex@qwest .net> wrote:[color=blue]
        > Try adding a wxYield() after the Update(). The Refresh() probably isn't
        > necessary.[/color]

        That did it. Thanks much!

        -----BEGIN PGP SIGNATURE-----
        Version: GnuPG v1.2.2 (GNU/Linux)

        iD8DBQE/PZ39el/srYtumcURAvuXAK CVKQ9LNLzCc+b3l P4j4x4tWrd9VgCf SrFv
        IDikEMBsT5n9MKK VygYawi4=
        =NYX+
        -----END PGP SIGNATURE-----

        --
        Steve C. Lamb | I'm your priest, I'm your shrink, I'm your
        PGP Key: 8B6E99C5 | main connection to the switchboard of souls.
        | -- Lenny Nero - Strange Days
        -------------------------------+---------------------------------------------

        Comment

        Working...