Skip to content Skip to sidebar Skip to footer

Tkinter Inner Padding Can't Be On Only One Side

This might be confusing but for some odd reason using ipadx or ipady in .pack() with (1,0) or like this: Label(root, text='Hello World').pack(ipadx=(1,0)) will always make this err

Solution 1:

The answer you linked to is wrong, and I'll update it. ipadx and ipady do not support a tuple as an argument. From the official tcl/tk docs:

-ipadx amount

Amount specifies how much horizontal internal padding to leave on each side of the slave(s). Amount must be a valid screen distance, such as 2 or .5c. It defaults to 0.

-ipady amount

Amount specifies how much vertical internal padding to leave on each side of the slave(s). Amount defaults to 0.

-padx amount

Amount specifies how much horizontal external padding to leave on each side of the slave(s). Amount may be a list of two values to specify padding for left and right separately. Amount defaults to 0.

-pady amount

Amount specifies how much vertical external padding to leave on each side of the slave(s). Amount may be a list of two values to specify padding for top and bottom separately. Amount defaults to 0.


Post a Comment for "Tkinter Inner Padding Can't Be On Only One Side"