Skip to content
Peter JOHN Matecsa edited this page Mar 17, 2022 · 1 revision

To apply padding to only one side of a widget in Pygubu Designer, separate the values of both sides with a space.

padx

For example, if you have: padx 50 in Pygubu, it will apply a padx of 50 to both sides (left and right). padx_50


If you want to apply the value only to the left side of the widget and not the right, change padx to 50 0 padx_right


Similarly, if you want to apply the padding to the right side of the widget, but not the left, change padx to 0 50 padx_left

This applies to both pack and grid and the same technique can be used for pady as well.

pady

If you have: pady 50 in Pygubu, it will apply the padding to both the top and the bottom of the widget.

pady_both


If you want to apply pady 50 to the top only, set pady to 50 0

pady_top


If you want to apply pady 50 to the bottom only, set pady 0 50

pady_bottom

Different padding on each side

The value of zero (0) means you don't want to set a value for that side, but you could specify a different value for each side.

For example, if you wanted the right side to have more spacing than the left: padx 20 40

padx_diff

That will give the left side of the widget a padx of 20 and the right side of the widget a padx of 40.

Clone this wiki locally