0

As you can see in the picture, everything is aligned properly, but the equation button is not symmetrical in size from both sides. For example if I change the equation character to a number, then everything is perfect. I tried to search if I could add padding to only one side of the button(not grid), but couldn't find a solution for it. Any ideas how to fix it?

Photo here

Here's the current code of the button:

button_equation = Button(window, text="=", bg=button_bg, fg=button_fg, activeforeground=button_afg,
                     activebackground=button_abg, highlightbackground=button_afg, borderwidth=button_border,
                     padx=26, pady=0, font=(font, 16))
LostHat
  • 33
  • 5
  • You can add padding to one side of a widget by putting it inside a tuple: `padx=(left,right)` or `pady=(up,down)`. Also, show us the code used for that button. – Delrius Euphoria Apr 17 '21 at 17:23
  • That cause an error in a widget, for example if I write padx=(1, 1), the error is "_tkinter.TclError: bad screen distance "1 1". Tuple works in a grid config, but I can't get it to work in a widget config. – LostHat Apr 17 '21 at 22:14
  • You should use it with grid, not as widget option. `button_equation.grid(....,padx=(..,..))`/ – Delrius Euphoria Apr 18 '21 at 00:11
  • If you used `grid()` on those buttons, add `sticky="ew"`. – acw1668 Apr 18 '21 at 01:07

0 Answers0