Aha! Thanks Robin (and Jim, who replied previously) for the help. I have
it going now -- changing the colors after the page was added.
And yes -- I am running on XP (XP Pro and XP for Tablets)
Hubert
Robin Dunn wrote:
Hubert Hickman wrote:
I have a really odd problem that is perplexing me. I am using wxPython
2.5.1 with ActiveState Python 2.3 with the PythonWin GUI.Here is the code in question:
[much setup code goes before here]
self.SetAutoLayout(1)
print "Setting background to green"
self.SetBackgroundColour(wx.GREEN)I am trying to set the background color of a wxPanel (that gets attached
to a wxNotebook). Running the program from a command prompt shows the
print statement, but no color change. Running the program from the
PythonWin IDE shows the print statement, and the color change!You are running on XP, right?
On XP when themes are enabled for the App then wxWidgets will
post-process pages added to a notebook to change their background
colours to match the theme settings. When you run from the command line
you are using python.exe or pythonw.exe for which wxPython's installer
installed a manifest file that turns on the use of the themed common
conrols for those .exe's. When you run from within PythonWin you are
using Pythonwin.exe which does not have a manifest file and so it is
using the old version of the common controls, hence no theme support and
so wxWidgets leaves the notebook pages alone.
If you want to ignore the theme bg colour for notebook pages then you
need to set the colour after it has been added to the notebook.