473,585 Members | 2,657 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[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
-------------------------------+---------------------------------------------
Jul 18 '05 #1
3 4507
Steve Lamb wrote in news:sl******** *********@teleu te.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_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?


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.
--
http://www.victim-prime.dsl.pipex.com/
Jul 18 '05 #2
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.RE MOVE.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
-----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/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
-------------------------------+---------------------------------------------
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
3251
by: perchef | last post by:
Hi, I have several files to download and a GUI to update. I know this is a frequently asked question but i can't find an appropriate solution. My Downloader extends threading.Thread and update a wx.Gauge in GUI during the process. for src in urls: downloader = Downloader( src, destination, GUI ) downloader.start()
4
6586
by: KvS | last post by:
Hi all, I'm pretty new to (wx)Python so plz. don't shoot me if I've missed something obvious ;). I have a panel inside a frame, on which a Button and a StaticText is placed: self.panel = wx.Panel(self,-1) self.button = wx.Button(self.panel,-1,"Klikkerdeklik") self.button.SetPosition((200,40)) self.Bind(wx.EVT_BUTTON, self.VeranderLabel,...
2
2113
by: Venu | last post by:
Hi Everyone, I'm very new to C# and I have the following problem - please help. I have a Windows Forms application called 'FunApp' which has a status bar. I also have a separate class library called FunTx compiled as a DLL. What I want to do is update the status bar from within a FunTx method - and I used delegates to try this. Here's...
9
5520
by: zxo102 | last post by:
Hi everyone, I am using a python socket server to collect data from a socket client and then control a image location ( wxpython) with the data, i.e. moving the image around in the wxpython frame. But the "app.MainLoop()" in wxpython looks like conflicting with the "while 1:" in socket server. After I commented the "app.MainLoop()",...
6
2104
by: cyberco | last post by:
In my wxPython app a non-GUI thread (that reads info from the network) tries to open a frame to show the new info. This results in my app hanging (which is not too surprising). Coming from a C# environment I wonder if there is some sort of delegate mechanism in wxPython to do this sort of thing. 2B
5
2604
by: Benjamin | last post by:
I'm writing a search engine in Python with wxPython as the GUI. I have the actual searching preformed on a different thread from Gui thread. It sends it's results through a Queue to the results ListCtrl which adds a new item. This works fine or small searches, but when the results number in the hundreds, the GUI is frozen for the duration of...
1
5792
by: K Viltersten | last post by:
> bar.PerformStep (); I noticed that there's a property for the bar stating what time it should take for the animation to move the fill to the requested spot. I'm guessing that's the time i should delay my text updating by. Correct? When you mentioned a delay - is there an other way to do it than threads? I've found this solution.
1
8327
by: dazzler | last post by:
Hi! I just moved using wxpython so I'm a quite newbie. I was wondering how to update plotcanvas? In my code I made button with event to update plotcanvas with new results, but how to properly do it? because now when I press button it makes new "layer" into my GUI and doesn't delete the old plot. Should I first delete the old one and then...
1
3115
by: Roland | last post by:
Hello, I am writing modal dialog box to display progress of downloading file. I am starting download of a file in constructor of dialog using some asynchronous method call which returns me an asynchronous object. I could use this object to get status. I will be using this status to update status message on dialog. Which method should I...
0
7908
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7836
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7950
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8212
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6606
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3863
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2343
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1447
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1175
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.