473,395 Members | 1,474 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

wxPython StatusBar Help

Hi, everybody

I'm working with wxPython 2.8.1.1.

Does anybody know how to change the foreground colors in a wx.StatusBar
Jan 29 '07 #1
1 2674
Hi,
I'm working with wxPython 2.8.1.1.

Does anybody know how to change the foreground colors in a wx.StatusBar
You can get inspiration from the following code, but the problem is you
will have also to draw all the status bar stuff, not only the foreground
color.
I don't know any other way. However, I'm used to 2.6 and I could miss
something existing in 2.8 (I think to OnCreateStatusBar which exists and
don't work in 2.6 and was supposed to work with the next release ; it
could be a clue).
Regards,
jm
import wx
class MyStatusBar(wx.StatusBar):
def __init__(self,*args,**kargs):
wx.StatusBar.__init__(self,*args,**kargs)
self.Bind(wx.EVT_PAINT,self.OnPaint)
def OnPaint(self,event):
dc = wx.PaintDC(self)
self.Draw(dc)
def Draw(self,dc):
dc.BeginDrawing()
dc.SetBackground( wx.Brush("White") )
dc.Clear()
dc.SetPen(wx.Pen('BLACK'))
dc.DrawText(self.GetStatusText(),0,0)
dc.EndDrawing()
if __name__ == "__main__":
app = wx.PySimpleApp()
frame= wx.Frame(None,wx.ID_ANY,'test frame')
statusBar= MyStatusBar(frame,wx.ID_ANY)
statusBar.SetStatusText("status text..")
frame.SetStatusBar(statusBar)
frame.Show(True)
app.MainLoop()
Jan 30 '07 #2

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

Similar topics

1
by: flupke | last post by:
Hi, i'm trying to convert my java console app to a python gui. Now, the only problem i seem to have at the moment are the resizers for the layout. It seems that for the purpose of what i'm...
1
by: mdk.R | last post by:
Hello all: i'am installed wxPython 2.5 and Python2.3.4..i try execute script with wxPython but it show error: Traceback (most recent call last): File "E:\py\test.py", line 7, in ? import wx...
0
by: Scott | last post by:
I have the code below. I have changed the background of the frame to white, but I cannot get the wxSlider to not be the ugly gray color. Can someone tell me how to change it to a transparent...
18
by: Andrew Poulos | last post by:
If I manage to call the following bit of javascript in IE and MZ w = window.open("", "s", 'status=no,resizable=no,width=450,height=450'); I get a window that is not resizable and without a...
2
by: rodmc | last post by:
I am totally new to Python and WxPython and need to write an application which can open up an external windows from a plug-in within GAIM (using pyGAIM). I have managed to hack some code together...
3
by: John Salerno | last post by:
I'm using the sample code of the file 'simple.py' and trying to make a single window with a panel in it, but I keep getting an error. Here's my code: (I know I might need something else, like a...
4
by: w.p. | last post by:
When i run MDISashDemo and maximize main frame, minimize and maximize again - LayoutMDIFrame in OnSize dont work more... Why? I need this feature for main MDI frame with toolbar and statusbar...
4
by: kkt49 | last post by:
# vim: et sw=4 ts=8 sts from wxPython.wx import * import sys, os, time import pywintypes import win32serviceutil import win32service import win32event import win32process
3
by: Netwatcher | last post by:
im try to activate the tutorial code for wxPython, it is working properly when i tell it to import * from wxPython.wx but with an error about the package, i've done as i was told to change the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...

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.