1
votes

Is there a way to add negative padding when placing a Tkinter widget in a grid ? Things such as myWidget.grid(padx=-10) do not work.

I am trying to display a Radiobutton and a Label side-by-side, my problem is the gap between the radio's text and the label's text is too wide, hence my question on adding a negative padding to the label.
Code:

rb = Radiobutton(text="foo") 
rb.grid(row=row, column=0, sticky=W) 
l = Label(text="bar") 
l.grid(column=1, sticky=W)

Thanks !

1
Kindly provide the code,so that we can help you better - Alok
rb = Radiobutton(text="foo") rb.grid(row=row, column=0, sticky=W) l = Label(text="bar") l.grid(column=1, sticky=W) Removing the 'sticky' option does not help. - GaTTaCa

1 Answers

1
votes

No, you cannot add negative padding. There are probably better ways to solve your problem. For example, since your label is to the right of the radiobutton, have you tried using the anchor option on the label so that the text is left-aligned?