Background color weirdness

Hi everyone!
I just noticed a little weirdness.. I have a classic Frame with a Sizer and a Panel, but when I do

panel.SetBackgroundColour(panel.GetBackgroundColour())

the panel color actually changes (becoming a little brighter, with my theme). Why does this happen?
I fear this is a FAQ, but couldn't find anything about it.. ^^;

Aside from that, is there a way to retrieve the "real" background color? (The slightly darker one, in my case)

Thanks for your time!

(wxPython 2.8.8.0 on Xubuntu 8.10 with "Glossy" theme)

Hello,

Hi everyone!
I just noticed a little weirdness… I have a classic Frame with a Sizer and a Panel, but when I do

panel.SetBackgroundColour(panel.GetBackgroundColour())

the panel color actually changes (becoming a little brighter, with my theme). Why does this happen?
I fear this is a FAQ, but couldn’t find anything about it… ^^;

Not completely sure but its probably just getting the default panel color that the panel is initialized with before any theming is applied.

Aside from that, is there a way to retrieve the “real” background color? (The slightly darker one, in my case)

See wx.SystemSettings_GetColour

Cody

···

On Fri, Feb 13, 2009 at 8:10 AM, Federico Fanton fake@panizzolo.it wrote:

Cody Precord wrote:
> I just noticed a little weirdness.. I have a classic Frame with a
> Sizer and a Panel, but when I do
>
> panel.SetBackgroundColour(panel.GetBackgroundColour())
>
> the panel color actually changes (becoming a little brighter, with
> my theme). Why does this happen?
> I fear this is a FAQ, but couldn't find anything about it.. ^^;
>
> Not completely sure but its probably just getting the default panel
> color that the panel is initialized with before any theming is applied.

I see..

> Aside from that, is there a way to retrieve the "real" background
> color? (The slightly darker one, in my case)
>
> See wx.SystemSettings_GetColour

I tried printing every wx.SYS_COLOUR* and the only matching one is
SYS_COLOUR_MENUBAR.. Weird indeed :slight_smile: I'll settle with that though.. Many
thanks!

Federico Fanton wrote:

Hi everyone!
I just noticed a little weirdness.. I have a classic Frame with a Sizer and a Panel, but when I do

panel.SetBackgroundColour(panel.GetBackgroundColour())

the panel color actually changes (becoming a little brighter, with my theme). Why does this happen?
I fear this is a FAQ, but couldn't find anything about it.. ^^;

Depending on your theme the default background may actually be a texture or a slight gradient rather than a solid color, and GetBackgroundColour is just returning a close approximation of the texture as a solid color value that it is getting from the system.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!