![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=1739292910-p6A1XqD7w632vQ9JSQrYTG6MMcf1GlI9-0-7807b3fc91febc09c08fc5086165843f)
Now, our LabelFrame gets some breathing space:
![](https://epubservercos.yuewen.com/A95289/19470408908965106/epubprivate/OEBPS/Images/GUI_add_padding.png?sign=1739292910-7S79A3PTKcsH4X9tmSbWjrOavej6ugdz-0-9fdd0e711fa0afa349c1934b6c268c79)