Search

The static box may be either created independently or the sizer may create it itself as a convenience. In any case, the sizer owns the wx.StaticBox control and will delete it in the wx.StaticBoxSizer destructor.

Note that since wxWidgets 2.9.1 you are encouraged to create the windows which are added to wx.StaticBoxSizer as children of wx.StaticBox itself, see this class documentation for more details.

Example of use of this class:

defCreateControls(self):panel=wx.Panel(self)# Other controls here...sz=wx.StaticBoxSizer(wx.VERTICAL,panel,"Box")sz.Add(wx.StaticText(sz.GetStaticBox(),wx.ID_ANY,"This window is a child of the staticbox"))# Other code...