![Python GUI Programming Cookbook(Second Edition)](https://wfqqreader-1252317822.image.myqcloud.com/cover/163/36701163/b_36701163.jpg)
上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
![](https://epubservercos.yuewen.com/A95289/19470408908965106/epubprivate/OEBPS/Images/Code_GUI_LabelFrame_padxy.png?sign=1739531012-voUtxLCqy23YiV41FA8RVBHftriSz3VW-0-fe8c1a45f7324cc30da9b7270beb2d74)
Now, our LabelFrame gets some breathing space:
![](https://epubservercos.yuewen.com/A95289/19470408908965106/epubprivate/OEBPS/Images/GUI_add_padding.png?sign=1739531012-fBVeCcgyiUiEzxn4gi6sPyGD190doq87-0-d61dc6e9a4ec960832986184943e02f9)