wx gridbagsizer is the most flexible sizer it allows widgets to be positioned relative to the grid and also allows widgets to span multiple rows and/or columns to use sizer it must first be instantiated when widgets are created they should be added to the sizer and then the sizer should be set on the container for examplethe following code uses gridsizer used with panel to layout out four widgets comprised of two buttonsa statictext label and textctrl input fieldcreate the panel panel wx panel(selfcreate the sizer to use with rows and column and spacing around each cell grid wx gridsizer( create the widgets text wx textctrl(panelsize=( - )enter_button wx button(panellabel='enter'label wx statictext(panel,label='welcome'message_button wx button(panellabel='show message'add the widgets to the grid sizer grid addmany([textenter_buttonlabelmessage_button]set the sizer on the panel panel setsizer(gridthe resulting display is shown below