Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2023-07-11
06:37 • Closed ticket [5510bec042]: Internal padding settings of grid geometry manager i... artifact: 227a3fe153 user: oehhar
05:49 • New ticket [5510bec042]. artifact: 2410a50dc0 user: 70091112

Internal padding settings of grid geometry manager inside Frame (eg: ipadx and ipady) are not working as explained in TK Documentation.

Closed / Rejected5510bec04291c0ee7c27a02a701307ca4efdaa4cCreated 3 years agoUpdated 3 years ago
Descriptionplain2023-07-11 05:49:11
Demonstration program to recreate the bug:

from tkinter import *
from tkinter import ttk
root=Tk() # New window is created.

frame1=ttk.Frame(root,relief='sunken',borderwidth=5) # First Frame is been defined. 
frame1.grid(column=0,row=0,padx=10,pady=10) # Outer padding(padx and pady) is given to First Frame. 

btn1=ttk.Button(frame1,text='Button1') # Button1, which is use as an slave widget of Frame1, is been defined. 
btn1.grid() # Button1 is created.


frame2=ttk.Frame(root,relief='sunken',borderwidth=5) # Second Frame is been defined. 
frame2.grid(column=1,row=0,ipadx=10,ipady=10) # Internal padding(ipadx and ipady) is given to Second Frame.

btn2=ttk.Button(frame2,text='Button2') # Button2, which is use as an slave widget of Frame2, is been defined. 
btn2.grid() # Button2 is created.

root.mainloop()


The above code demonstrate the bug discuss in this bug report. 

Problem: Internal padding for grid layout inside Frame widget is not working as per Grid reference manual (accessible at : https://tcl.tk/man/tcl8.6/TkCmd/grid.htm).

	In this reference manual internal padding attribute(ipadx and ipady) are explained as below:
		-ipadx amount: "The amount specifies how much horizontal internal padding to leave on each side of the content. This is space is added inside the content border. The amount must be a valid      screen distance, such as 2 or .5c. It defaults to 0."

		-ipady amount: "The amount specifies how much vertical internal padding to leave on the top and bottom of the content. This space is added inside the content border. The amount defaults to 0." 
		
		
In above explanation it is clearly mentioned that internal padding is LEAVE ON EACH SIDE OF THE CONTENT.
-But as we can see in the demonstrated window generated using our demonstrated program the padding between borders of frame2 and btn2 are not equal on each side. There is no padding between frame2's top border and btn2's top border as well as frame2's left border and btn2's left border. Furthermore, the padding expected on the left side and top side are being added to the right side and bottom side respectively. This behavior is not as per explained in the reference manual.

-The external padding (using: padx,pady) is working perfectly as explained in reference manual but internal padding (using: ipadx,ipady) is not working as explained in reference manual.

CONCUSSION: THE INTERNAL PADDING MUST BE EQUAL ON EACH SIDE.
oehharplain2023-07-11 06:37:24
Thanks for the ticked, what is appreciated.
Please allow me to transfer the ticket to the Tk area (this is TCL) and close it.

The issue will be followed here:

[https://core.tcl-lang.org/tk/info/58cdb943bed892a6]

Thank you for your understanding,
Harald
Log in (anonymous is fine) to add a comment.