Adding a toplevel sizer
Prev | Chapter 6. wxGlade technical notes | Next

## Adding a toplevel sizer

This is similar to the addition of a toplevel widget, but the action is performed in two steps:

- when the user clicks on the button in the palette, the method “`add_object`” of `wxGladeFrame` is called: this sets the global variables “`common.adding_widget`” and “`common.adding_sizer`” to `True`, and stores the class name of the sizer to add in the global “`common.widget_to_add`” (the name is obtained from the “`common.refs`” dictionary as described above)

- when the user left-clicks the mouse inside the previously added toplevel widget, its “`drop_sizer`” method is called, which is responsible of the addition of the sizer: it calls the factory function for the sizer (passing self as the first argument), which will build the object and add it to the tree

Prev | Up | Next
Adding a toplevel widget | Home | Adding a normal widget/sizer