473,804 Members | 3,481 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2694
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()
Jan 30 '07 #2

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

Similar topics

1
2072
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 trying to do, specifying the coordinates is easier that fighting with the layout resizers. 1) I have a screen split in 2. Left side is a textcontrol where logging will end up. All text will be appended to the textcontrol. Ideally this should allow...
1
2166
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 File "E:\py\wx.py", line 10, in ? from wxPython.wx import * File "D:\Python23\Lib\site-package import _wx
0
1216
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 background (I tried wxTRANSPARENT_WINDOW without success)? import os from wxPython.wx import * ID_ABOUT=101 ID_EXIT=110 class MainWindow(wxFrame):
18
2504
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 statusbar. Yet FF gives me both a statusbar and the window is resizable! Does this mean that FF does not support these "features" or is there a different way to code them for FF?
2
1715
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 from what little I have covered so far, however GAIM refuses to open until I have closed the extra window. I appreciate this is probably a simple point but I would be grateful for any advice people can offer on how I can make them both appear so...
3
3219
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 Show() method for the panel, but the error stops on the first panel line anyway. I've tried a Layout() method but it didn't get that far). import wx class MyFrame(wx.Frame):
4
1454
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 with panels&sizers&bitmapbuttons :) Windows 2000, wxPython 2.6.1.0 w.p.
4
3184
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
18050
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 import to wx and change all wxsomething to wx.something but when i start it it gives me an error that say Traceback (most recent call last): File "C:/Python25/Sd", line 32, in <module> app = MyApp(0)
0
9710
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9589
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10593
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10340
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7626
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6858
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5527
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3830
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3000
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.