wxWidgets and Python
So recently I've been playing with wxWidgets and Python. I've enjoyed it so far, but I've found one problem that I haven't really found a good solution for. When creating a window in Windows, the default background seems to be a rather dark gray. My theme for Windows is the windows classic, which shows all windows as a light grey color. The menu bar and the status bar of the application are the light grey desired, but the background of the application itself and any text label widgets I create are all dark gray. It makes no sense to me.
The solution I've found so far is to set the main window background to the color of the menubar background. This seems to make everything conform to the default light gray. Here's the code from my custom wx.Frame class:
self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_MENUBAR))
self.SetBackgroundStyle(wx.BG_STYLE_COLOUR)
This sets the frame's background to the correct expected color. I'm not sure if this is the way I should be going about things since I'm new to wxWidgets, so if anyone has any suggestions for me, please let me know! I'll post an update later this week when I get further along with my client. Right now I've taken a break from the SimpleIRC bot part of things and am creating a GUI interface for a client. Until next time!
January 19th, 2008 - 09:06
This is answered here
http://www.wxwidgets.org/wiki/index.php/FAQ#Why_are_backgrounds_of_windows_ugly.2C_dark_grey_on_Windows.3F_I_want_them_like_my_dialog_boxes.
You need to add a top-level panel to your wxFrame.