By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,946 Members | 712 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,946 IT Pros & Developers. It's quick & easy.

[wxPython] Updating the status bar?

P: n/a
-----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
-------------------------------+---------------------------------------------
Jul 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Steve Lamb wrote in news:sl*****************@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/
Jul 18 '05 #2

P: n/a
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 <rt*@freenet.REMOVE.co.uk> 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
Jul 18 '05 #3

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, 15 Aug 2003 14:09:50 -0700, Cliff Wells <lo******@qwest.net> 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
-------------------------------+---------------------------------------------
Jul 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.