[wxPython] Updating the status bar?

Rob Williscroft rtw at freenet.REMOVE.co.uk
Mon Aug 11 01:32:10 EDT 2003


Steve Lamb wrote in news:slrnbje71n.k27.grey at teleute.dmiyu.org:

>     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_spam,
>             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?

>From the wxWindows help file:

wxWindow::Update
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.
-- 
http://www.victim-prime.dsl.pipex.com/




More information about the Python-list mailing list