-
Book Overview & Buying
-
Table Of Contents
wxPython Application Development Cookbook
By :
The StaticBox control is a type of static control that is used to group or organize controls that perform related actions together. It provides a label text and an outlining border around the grouped controls. In previous versions of wxPython, StaticBox had an irregular sibling relationship with the controls that it contained, which was, needless to say, outside the mold of the overall hierarchy of the framework. However, starting from version 2.9 onward, StaticBox can be treated similarly to a special panel that is the parent of the controls it contains. In this recipe, we will take a quick look at how to add controls to StaticBox.
Here are the steps for this recipe:
First, let's start off by making a little wrapper class around StaticBox to encapsulate StaticBoxSizer and add a couple of convenience methods, as follows:
class GroupBox(wx.StaticBox):
def __init__(self, parent, orient, label=""):
super(GroupBox, self).__init__...
Change the font size
Change margin width
Change background colour