Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > [wxPython] Updating the status bar?

Reply
Thread Tools

[wxPython] Updating the status bar?

 
 
Steve Lamb
Guest
Posts: n/a
 
      08-11-2003
-----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_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?

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

iD8DBQE/Nxw5el/srYtumcURAkUaAKCsZep0u8rjIalqXYJ4+8BbeqmdVgCfRbYx
3vIlOU4xsEXlLQI5+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
-------------------------------+---------------------------------------------
 
Reply With Quote
 
 
 
 
Rob Williscroft
Guest
Posts: n/a
 
      08-11-2003
Steve Lamb wrote in news:(E-Mail Removed):

> 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/
 
Reply With Quote
 
 
 
 
Cliff Wells
Guest
Posts: n/a
 
      08-15-2003
On Fri, 2003-08-15 at 13:06, Steve Lamb wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 11 Aug 2003 05:32:10 GMT, Rob Williscroft <(E-Mail Removed)> wrote:
> > So I would guess at:

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

>
> Finally got around to trying this and no dice. Still does not
> update the status bar at all. :/


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


 
Reply With Quote
 
Steve Lamb
Guest
Posts: n/a
 
      08-16-2003
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, 15 Aug 2003 14:09:50 -0700, Cliff Wells <(E-Mail Removed)> wrote:
> Try adding a wxYield() after the Update(). The Refresh() probably isn't
> necessary.


That did it. Thanks much!

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

iD8DBQE/PZ39el/srYtumcURAvuXAKCVKQ9LNLzCc+b3lP4j4x4tWrd9VgCfSrFv
IDikEMBsT5n9MKKVygYawi4=
=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
-------------------------------+---------------------------------------------
 
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
Updating JTable Atomically - block data changes while updating. news.rcn.com Java 2 12-10-2007 11:49 AM
Recommend a free 'Status Monitor' or 'Dashboard' to report overnight tasks status? Shug Java 13 12-15-2006 06:22 PM
Recommend a free 'Status Monitor' or 'Dashboard' to report overnight tasks status? Shug C++ 13 12-15-2006 06:22 PM
POST problem - IIS sc-win32-status:64; sc-status:400 saha ASP .Net 0 07-14-2005 07:10 AM
Updating my MCSE status........ Hendri Soemijarsih MCSE 3 04-30-2004 05:47 PM



Advertisments