Tell me the difference between pad-x/y and ipad-x/y. Are both same OR not
Asked
Active
Viewed 6,972 times
7
-
5**ipadx, ipady** − How many pixels to pad widget, horizontally and vertically, *inside* widget's borders. **padx, pady** − How many pixels to pad widget, horizontally and vertically, *outside* v's borders. – Jun 07 '21 at 05:00
-
2Or as I would like to remember, `ipadx` to be short for inner-padx – Delrius Euphoria Jun 07 '21 at 06:34
1 Answers
9
ipadx, ipady − How many pixels to pad widget, horizontally and vertically, inside widget's borders. padx, pady − How many pixels to pad widget, horizontally and vertically, outside v's borders
Example:
Here is ipadx
. You can see the that the width has increased. It means that 20 pixels are there to the right and left of the Label. 20 pixels are padded horizontally. Similarly it is for ipady
except it is vertical.
from tkinter import *
root=Tk()
Label(root,bg='light grey',text="Hello").grid(row=0,column=0,ipadx=20)
root.mainloop()
And here it is in case of padx
. The widget is placed 20 pixels to the side, horizontally. Same is the case for pady
except it is vertical.
from tkinter import *
root=Tk()
Label(root,bg='light grey',text="Hello").grid(row=0,column=0,padx=20)
root.mainloop()