Navigation Logo 13.4  Padding Navigation Logo

 

 

The pack configure and grid configure actions have options -padx, -pady, -ipadx, and -ipady for putting margins around widgets.

The suffix "x" means the option pads horizontally and the suffix "y" means it pads vertically.

With the first two options, the slice or cell containing the widget is enlarged. With the second two, the widget becomes larger – the extra space is just inside the border.

Use screen distance measurements for the padding options.

Figure 13.4a illustrates the effects of these options.

Figure 13.4a: Examples of padding.
pack [label .lab1 -text {No Padding} -relief ridge]
pack [label .lab2 -text {Internal Padding} -relief ridge] -ipadx 5 -ipady 5
pack [label .lab3  -text {Padding} -relief ridge] -padx 5 -pady 5 

 

 

[Sample TK Application]
Author's Home Page
Navigation Logo [Book's Cover]
Order from Amazon.