If you find yourself using the normal Sizer-based layouts to be somewhat tedious or cumbersome, there are some other options through the sized_controls
library available in the wx.lib
namespace. This library provides a number of specialized controls to help streamline and simplify the use of Sizers. These controls automatically create Sizers and add their child controls to them based on the layout mode of SizedControl
. In this recipe, we will give an introduction to this library by making use of SizedScrolledPanel
to lay out a number of controls.
Perform the following steps:
First, we will start by declaring a subclass of
SizedScrolledPanel
and setting the Sizer layout type to use through the following code:class MyPanel(sized.SizedScrolledPanel): def __init__(self, parent): super(MyPanel, self).__init__(parent) self.SetSizerType("form")
Now, we can instantiate the controls to add them into the layout:
label = wx.StaticText...