Python GUI Programming Cookbook(Second Edition)
上QQ阅读APP看书,第一时间看更新

How to do it...

The procedural way of adding spacing around widgets is shown first, and then we will use a loop to achieve the same thing in a much better way.

Our LabelFrame looks a bit tight as it blends into the main window towards the bottom. Let's fix this now.

Modify line 110 of the code snippet from GUI_LabelFrame_column_one.py in the previous recipe by adding padx and pady. You can also find the code in: 

GUI_add_padding.py

Now, our LabelFrame gets some breathing space: