It seems that wx.Panel.SetBackgroundColour doesn't always work. Or something else is setting it to some other colour slightly after my call.
Here's an example using wx.Notebook. The first panel does not have the specified (reddish) colour, the second does. The second panel has its BackgroundColour set in a EVT_SIZE event handler.
Here's an example using wx.Notebook. The first panel does not have the
specified (reddish) colour, the second does. The second panel has its
BackgroundColour set in a EVT_SIZE event handler.
Is this a bug?
Kind of "feature". wx.Notebook love to setup pages colour according to the
current windows "theme". If you definetily need to change page color, you
should do it _after_ page is added to notebook. Your approach (using
EVT_SIZE) is IMHO a bit exotic. You can use wx.CallAfer for the same
purpose.
It seems that wx.Panel.SetBackgroundColour doesn't always work. Or something else is setting it to some other colour slightly after my call.
wxWidgets is attempting to conform to the XP theme setting for notebook page backgrounds. This is handed in a much better way in 2.5, but in 2.4 it is just recursivly setting bg colours when you call AddPage. If you need a different bg then you can set it after the AddPage call.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
This is incredibly enlightening. Is there any chance that this will be documented, or is the existence of the wx.NotebookPage class in 2.5.x considered documentation enough?
EVT_SIZE was just some event that I knew would be called later, on the grounds that I didn't know when wx.Notebook might set the background colour.
David Jones
···
On Apr 08, 2005, at 17:35, Vladimir Ignatov wrote:
Hi!
Here's an example using wx.Notebook. The first panel does not have the
specified (reddish) colour, the second does. The second panel has its
BackgroundColour set in a EVT_SIZE event handler.
Is this a bug?
Kind of "feature". wx.Notebook love to setup pages colour according to the
current windows "theme". If you definetily need to change page color, you
should do it _after_ page is added to notebook. Your approach (using
EVT_SIZE) is IMHO a bit exotic. You can use wx.CallAfer for the same
purpose.
Kind of "feature". wx.Notebook love to setup pages colour according to the
current windows "theme". If you definetily need to change page color, you
should do it _after_ page is added to notebook. Your approach (using
EVT_SIZE) is IMHO a bit exotic. You can use wx.CallAfer for the same
purpose.
This is incredibly enlightening. Is there any chance that this will be documented, or is the existence of the wx.NotebookPage class in 2.5.x considered documentation enough?
This question probably best be routing to the core developers. From my (ordinary user) point of view this is an "unstable feature". I beleive some times ago (in 2.4.x series?) this feature was not here, then it was introduced and then (at least in 2.5.5.1 version) things are changed again. If your application depends on this, then best thing you can do is to write an unittest and run it every time you upgrade to the newer version of wxPython.
I attach my unittesting code for wxNotebook. It is very basic for now. Functions test_page_color_NOT_changed_on_AddPage() passed okay on my box (WindowsXP,Python2.3.5,wxPython2.5.5.1)
EVT_SIZE was just some event that I knew would be called later, on the grounds that I didn't know when wx.Notebook might set the background colour.
wxNotebook can adjust page's background during AddPage(). You just need to (somehow) setup page color _after_ adding page to the notebook.
Understood. I "simply" changed my application so that anything which may be added to a wx.Notebook supports a protocol (er, a method I suppose you might call it) to set its colour afterward. That way, I don't care whether wx.Notebook.AddPage sets background colours or not.
David Jones
···
On Apr 11, 2005, at 12:02, Vladimir Ignatov wrote:
EVT_SIZE was just some event that I knew would be called later, on the grounds that I didn't know when wx.Notebook might set the background colour.
wxNotebook can adjust page's background during AddPage(). You just need to (somehow) setup page color _after_ adding page to the notebook.
Here's an example using wx.Notebook. The first panel does not have the
specified (reddish) colour, the second does. The second panel has its
BackgroundColour set in a EVT_SIZE event handler.
Is this a bug?
Kind of "feature". wx.Notebook love to setup pages colour according to the
current windows "theme". If you definetily need to change page color, you
should do it _after_ page is added to notebook. Your approach (using
EVT_SIZE) is IMHO a bit exotic. You can use wx.CallAfer for the same
purpose.
This is incredibly enlightening. Is there any chance that this will be documented, or is the existence of the wx.NotebookPage class in 2.5.x considered documentation enough?
The wx.NotebookPage class is there to work around a different problem, which is becoming less of an issue with each passing day since it only affects the old GTK 1.2.x port.
As I said before the backgrounds on MSW are handled quite differently on 2.5 and so you probably won't need to worry about this at all.
···
On Apr 08, 2005, at 17:35, Vladimir Ignatov wrote:
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!