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 OnCreateStatusB ar 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,*ar gs,**kargs)
self.Bind(wx.EV T_PAINT,self.On Paint)
def OnPaint(self,ev ent):
dc = wx.PaintDC(self )
self.Draw(dc)
def Draw(self,dc):
dc.BeginDrawing ()
dc.SetBackgroun d( wx.Brush("White ") )
dc.Clear()
dc.SetPen(wx.Pe n('BLACK'))
dc.DrawText(sel f.GetStatusText (),0,0)
dc.EndDrawing()
if __name__ == "__main__":
app = wx.PySimpleApp( )
frame= wx.Frame(None,w x.ID_ANY,'test frame')
statusBar= MyStatusBar(fra me,wx.ID_ANY)
statusBar.SetSt atusText("statu s text..")
frame.SetStatus Bar(statusBar)
frame.Show(True )
app.MainLoop()