If I run
panel.SetBackgroundColour(panel.GetBackgroundColour())
on a wxPython panel, the colour changes!
What’s happening here? And how do I get the real colour being used?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If your current GTK theme uses a texture for the background then it probably defines an approximate match for the background color, which is what you get from GetBackgroundColour. By passing that to the setter you’re telling the window to use that color instead of the texture.
Another possibility is if the theme alters the default color in certain contexts, such as what Windows will do if the panel is a page in a notebook. By setting the color to something else (even if it’s the default) then you are overriding the theme and it will not do whatever it is doing to the windows color.