In this tutorial, I will take my code from the GridSizer tutorial I wrote the other day and heavily modify it to display oddly shaped widgets in a GridBagSizer. The GridBagSizer is the most complex of the sizers. It subclasses the FlexGridSizer, so you can use all of it’s parent’s methods as well as those that the GridBagSizer adds. See the docs or use Python’s help() functionality for more information on said methods.
Entries tagged with “sizer”.
Thu 22 May 2008
wxPython Sizers Tutorial: Using a GridBagSizer
Posted by Mike under Cross-Platform, Python, wxPython
[2] Comments
Wed 21 May 2008
wxPython: GridSizers and Fat TextCtrls
Posted by Mike under Python
No Comments
In my last post, I wrote how to use a GridSizer to create a generic form. Unfortunately, the wx.TextCtrls all ended up looking fat. It seems that passing a wx.EXPAND flag to the GridSizer when adding the TextCtrl causes it to expand to fill the cell as well as resize when the window itself is resized.
Mon 19 May 2008
wxPython Sizers Tutorial: Using a GridSizer
Posted by Mike under Cross-Platform, Python, wxPython
No Comments
In my last post, I created a generic form in wxPython using only wx.BoxSizers for automatic sizing of my widgets. This time, I am adding on to my previous example using a wx.GridSizer to show the following:
- How to right-align the icon and the label
- How to vertically align the label with the text control
- How to keep the text controls lined up no matter what the length of the labels are.
Sun 18 May 2008
A wxPython Sizers Tutorial
Posted by Mike under Python
[2] Comments
I volunteered to write some tutorials on common GUI layouts in wxPython. The following example came from Malcolm, one of the members of the wxPython user’s group.
