[wxpython-users] Changing the Style of text in the StatusBar
Paul McNett
p at ulmcnett.com
Thu May 15 15:34:27 PDT 2008
Timothy Grant wrote:
> I have some text in my status bar...
>
> Pop 1234 (-5)
>
> I would LOVE to be able to colour the number in the parens RED when it's
> negative and GREEN when it's positive.
>
> So far the only thing I've been able to come up with is to put a
> TextCtrl that's read only down there and then style the text inside the
> TextCtrl.
>
> Is there an easier way? or is that what I need to implement?
Draw directly onto the window's DC, changing the pen color when drawing
the negative numbers. You'll have to track where exactly you want to
draw the text by figuring out how much width the font will take, etc.
If you need pointers on DC drawing, just ask!
Paul
More information about the wxpython-users
mailing list