© Mike Driscoll 2018
Mike DriscollwxPython Recipeshttps://doi.org/10.1007/978-1-4842-3237-8_3

3. Special Effects

Mike Driscoll
(1)
Ankeny, New York, USA
 

Recipe 3-1. Resetting the Background Color

Problem

There are times when you want to change the background color of a Panel widget or some other widget in the wxPython GUI toolkit. Changing the background color is pretty handy for making an error more prominent or just for differentiating states in your application. But what’s not so obvious is how you might change the color back. When I first dug into resetting the background color of a Panel, I thought the following would work great:
color = wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND)
panel.SetBackgroundColour(color)
Unfortunately, ...

Get wxPython Recipes: A Problem - Solution Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.