- Note that since wxWidgets 2.9.0 you are encouraged to build the windows which are
- placed inside wxStaticBoxes as children of the wxStaticBox itself:
+ Note that while the previous versions required that windows appearing
+ inside a static box be created as its siblings (i.e. use the same parent as
+ the static box itself), since wxWidgets 2.9.1 it is also possible to create
+ them as children of wxStaticBox itself and you are actually encouraged to
+ do it like this if compatibility with the previous versions is not
+ important.
+
+ So the new recommended way to create static box is:
+ @code
+ void MyFrame::CreateControls()
+ {
+ wxPanel *panel = new wxPanel(this);
+ wxStaticBox *box = new wxStaticBox(panel, wxID_ANY, "StaticBox");
+
+ new wxStaticText(box, wxID_ANY "This window is a child of the staticbox");
+ ...
+ }
+ @endcode
+
+ While the compatible -- and now deprecated -- way is