Use ipady and ipadx to add pixels inside the button (unlike pady and padx, which add pixels outside):

my_button = ttk.Button(self, text="Hello World !")
my_button.grid(row=1, column=1, ipady=10, ipadx=10)
Answer from Benyassine Adnan on Stack Overflow
🌐
TutorialsPoint
tutorialspoint.com › changing-ttk-button-height-in-python
Changing ttk Button Height in Python
April 21, 2021 - We can change button size in Python Tkinter using several methods ? Using Width and Height − Set the width and height properties to determine button size in text units for text buttons.
Discussions

How do I make the buttons be square in Tkinter?
By default, width and height of Tkinter buttons is set in text units. A text unit is either the width or the height of the character 0 (zero) in the font you're currently using. So you can see the problem. 10 text units high is more distance than 10 text units wide, and the difference depends on which font you're using. You can set the size of the button in pixels using a bit of a trick. If you add an image to the button, the size values will be interpreted as pixels. So, you can just create a blank 1x1 image and add it to the button. You also need to set the button's "compound" parameter so that it shows both the text and image. Here's a sample: import tkinter as tk root = tk.Tkinter() i = tk.PhotoImage(width=1, height=1) # this button will be tall and rectangular, because it's using text units b1 = tk.Button(root, text='text units', width=20, height=20) b1.pack # this button will be square, because it's using pixels b2 = tk.Button(root, text='Pixels', image=i, compound='c', width=100, height=100) b2.pack root.mainloop() More on reddit.com
🌐 r/learnpython
2
9
March 18, 2022
python 3.x - How can I change the width and height of a tkinter ttk Button (showing only text) in pixels? - Stack Overflow
Alternately, you can add a single ... the frame width and height in pixels, and the button will fill that frame. ... Sign up to request clarification or add additional context in comments. ... Yuour 1st solution works with tkinter Button not with ttk Button.... More on stackoverflow.com
🌐 stackoverflow.com
python - tkinter button height and width - Stack Overflow
I am trying to create a button and change the height and width using the code below but the actual button doesn't show physically. However if you hover over the area it is supposed to be and click it More on stackoverflow.com
🌐 stackoverflow.com
python - Is it possible to reduce a button size in tkinter? - Stack Overflow
I'm working on a little text editor and currently making the buttons, on the picture bellow the 'B' button for bold. I would like to reduce his size in order to make him fit his true size, like a s... More on stackoverflow.com
🌐 stackoverflow.com
🌐
TutorialsPoint
tutorialspoint.com › how-do-i-change-button-size-in-python-tkinter
How do I change button size in Python Tkinter?
October 4, 2024 - #Import the required libraries from tkinter import * #Create an instance of tkinter frame win= Tk() #Set the geometry of frame win.geometry("600x600") # make the window non-resizable win.resizable(False, False) Button(win, text="Button-1",height= 3, width=10).pack() Button(win, text="Butto...
🌐
Delft Stack
delftstack.com › home › howto › python tkinter › how to change the tkinter button size
How to Change the Tkinter Button Size | Delft Stack
February 5, 2025 - As you could see, the height and width of the button are not the same in the pixels although its width and height are set to be both 10.
🌐
ttkbootstrap
ttkbootstrap.readthedocs.io › en › version-0.5 › widgets › button.html
Button — ttkbootstrap documentation - Read the Docs
It can display itself in either of three different ways, according to the state option; it can be made to appear raised, sunken, or flat; and it can be made to flash. When a user invokes the button (by pressing mouse button 1 with the cursor over the button), then the command specified in the command option is invoked. ... This is a style guide for using ttkbootstrap styles.
🌐
TutorialKart
tutorialkart.com › python › tkinter › button › height
Tkinter Button height - Set Height of Button
February 3, 2025 - Tkinter Button height option sets height of the button in text lines (for textual buttons) or pixels (for images). In this tutorial, you will learn how to use height option to change the height a button.
🌐
Reddit
reddit.com › r/learnpython › how do i make the buttons be square in tkinter?
r/learnpython on Reddit: How do I make the buttons be square in Tkinter?
March 18, 2022 -

I tried to do it with padx and pady by setting them to the same value, not square.

I tried to do it with width and height parameters also setting them to the same value, it's still not square.

I am stuck, does anyone know why these methods are not working and which ones do?

Find elsewhere
🌐
Finxter
blog.finxter.com › home › learn python blog › 5 best ways to change ttk button height in python
5 Best Ways to Change TTK Button Height in Python - Be on the Right Side of Change
March 6, 2024 - The image’s dimensions are set to have the desired height, and the width is set to a minimal value so it doesn’t affect the width of the button. This approach can be helpful when other methods don’t provide the exact look you need. Sometimes you may want to adjust the button size dynamically, based on user actions or other programming conditions. You can do this by altering the button’s style properties at runtime. ... import tkinter as tk from tkinter import ttk def increase_height(event=None): style.configure('Dynamic.TButton', height=style.lookup('Dynamic.TButton', 'height') + 2) root = tk.Tk() style = ttk.Style(root) style.configure('Dynamic.TButton', height=20) btn = ttk.Button(root, text='Increase Height', style='Dynamic.TButton') btn.bind('<Button-1>', increase_height) btn.pack() root.mainloop()
🌐
Tkinter
tkinter.com › how-to-resize-buttons-in-ttkbootstrap-tkinter-ttkbootstrap-4
How To Resize Buttons in TTKBootstrap – Tkinter TTKBootstrap 4 – TKinter.com
January 3, 2023 - from tkinter import * import ttkbootstrap as tb root = tb.Window(themename="superhero") #root = Tk() root.title("TTK Bootstrap!") root.iconbitmap('images/codemy.ico') root.geometry('500x350') # Style my_style = tb.Style() my_style.configure('success.Outline.TButton', font=("Helvetica", 18)) my_button = tb.Button(text="Hello World!", bootstyle="success", style="success.Outline.TButton", width=20) my_button.pack(pady=40) root.mainloop()
🌐
TkDocs
tkdocs.com › pyref › ttk_button.html
TkDocs - ttk.Button
Ttk Button widget, displays a textual label and/or image, and evaluates a command when pressed.
🌐
YouTube
youtube.com › watch
How To Resize Buttons in TTKBootstrap - Tkinter TTKBootstrap 4 - YouTube
In this video I'll show you how to resize buttons and give them different sized fonts, with ttkbootstrap and tkinter.To resize a button and it's font with tt...
Published   January 3, 2023
🌐
Stack Overflow
stackoverflow.com › questions › 75715167 › how-can-i-change-the-width-and-height-of-a-tkinter-ttk-button-showing-only-text
python 3.x - How can I change the width and height of a tkinter ttk Button (showing only text) in pixels? - Stack Overflow
I made a little test program to see if is possible to set the width in pixels of a ttk.Button, seems I am not able to do it: def testButtonsType(): def select(choice): choice = choice if choice=="yes": print("yes") else: print("no") #--------------------------------------------------------------------------- mainWin = Tk() mainWin.title("Main Window") mainWin.geometry('400x250') pixel = tk.PhotoImage(width=1, height=1) s = ttk.Style() s.configure("osk.TButton",foreground="black", background="white", height=50, # padding=[10, 10, 10, 10], font = "None 14 bold") btnYes = ttk.Button(mainWin, text
Top answer
1 of 3
6

Regarding your initial question: the button does appear physically. The problem is, since it is so large, it is hard to distinguish from the rest of the window.

Now, you said that your ultimate goal is to change the size of a button. If so, then you are on the right track: you use the height and width options for this.

However, I would recommend that you make a few changes to your code:

  1. Don't make the button so huge. Even on a very big monitor, having a button be that size is way overkill.
  2. Don't make the window so huge. Nobody wants an application that takes up the entire screen.
  3. Use .grid instead of .place. Doing so will make it easier for you to place widgets where you want them.
  4. Set the height and width options when you make the button, not after it.
  5. There is no need to import sys here. Only import what you need.
  6. Don't import like this: from tkinter import *. Doing so dumps a whole bunch of names in the global namespace that can easily be overwritten.

Here is my version of your script:

import tkinter as tk

def mmWindow():
    mmWindow = tk.Tk()
    mmWindow.geometry('600x600')

mWindow = tk.Tk()
# You can set any size you want
mWindow.geometry('500x500+0+0')
mWindow.title('DMX512 Controller')

wtitle = tk.Label(mWindow, text="Pi DMX", fg='blue')
wtitle.grid(row=0, column=1)

# You can set any height and width you want
mmbutton = tk.Button(mWindow, height=5, width=20, text="Main Menu", command=mmWindow)
mmbutton.grid(row=1, column=1)

mWindow.mainloop()
2 of 3
1
import sys
from tkinter import *

def update_window_size():
    mmWindow.geometry('600x600')

mmWindow  = Tk()
mmWindow .geometry('1920x1080+0+0')
mmWindow .title('DMX512 Controller')

wtitle = Label(mmWindow, text="Pi DMX", fg='blue')
wtitle.place(relx=0.33, rely=0.0925925)

mmbutton = Button(mmWindow, text="Main Menu", command=update_window_size)
mmbutton.place(relw=0.104167, relh=0.185185, relx=0.104167, rely=0.185185)

mmWindow.mainloop()

I know this is late, but just want to add my method of how to solve the issue of how to make the button size change. I believe using place with relw and relh will be a better way to go. relw and relh & relx and rely will be fraction of the height and width of the parent widget. Therefore you do not need to worry about adjusting the size of both the wtitle and mmbutton.

If you want to change it's width and height from place then just put the code below on button command.

def update_button_size():
    mmbutton.place(width=20, height=20)

mmbutton = Button(mmWindow, text="Main Menu", command=update_button_size)
mmbutton.place(width=400, height=400, relx=0.104167, rely=0.185185)

If you want to change it's width and height from config then use code below.

def update_button_size():
    mmbutton.config(width=20, height=20)

mmbutton = Button(mmWindow, text="Main Menu", command=update_button_size)
mmbutton.place(relx=0.104167, rely=0.185185)
mmbutton.config(width=400, height=400)

From my understanding config width and height is different from place width and height.

🌐
YouTube
youtube.com › watch
How to Change the Width and Height of a Tkinter ttk Button in Pixels - YouTube
Discover how to effectively set the pixel dimensions for your Tkinter ttk buttons, perfect for optimizing your on-screen keyboard design!---This video is bas...
Published   May 25, 2025
Views   1
🌐
TutorialKart
tutorialkart.com › python › tkinter › button › width
Tkinter Button width - Set width of Button
February 3, 2025 - Tkinter Button height option sets width of the button in text lines (for textual buttons) or pixels (for images). In this tutorial, we will learn how to use width option to change the width of Tkinter Button.
Top answer
1 of 1
3

Button Height: If you notice, the height of frame_1 is 30 and the height of the buttons are 100 and 20. One button height is significantly taller than frame_1. So if you maximise your tk window, you will see the height difference of the buttons. Alternatively, try setting one button height to 10 and the other to 2, and rerun your script, to see the height difference. Conclusion, the button heights can be changed.

Button Lateral Placement: The lateral placement of the buttons can be controlled by using the padx=[x_left, x_right] option of the pack system. x_left and x_right denotes the horizontal external padding to be left on each side of the button in relations to it's parent. Your can read Tk documentation for a clearer explanation on the Packer's algorithm.

from tkinter import * 
selection_window = Tk()
selection_window.wm_title("")
selection_window.geometry('{}x{}'.format(200, 150))
frame_1 = Frame(selection_window, width=200, height=30)
frame_1.pack()
Button(frame_1, text="Single",height = 10).pack(side=LEFT, anchor=S, padx=[0,40])
Button(frame_1,text="Range",command=Toplevel,height = 2).pack(side=RIGHT, anchor=S, padx=[20,0])
selection_window.mainloop()

Height: Placement:

Part 2: Per comments below, please run below script to see if changing a ttk.Button height is even possible for OSX using 'non-default' style themes and post your finding in the comment section. It worked on my Ubuntu.

from tkinter import *
import tkinter.ttk as ttk
s=ttk.Style()
print('Style themes on my system are ', s.theme_names())
s.theme_use('clam')
s.configure('bb.TButton', background='white', padding=50)
b1=ttk.Button(text='Default')
b1.pack(side=LEFT, anchor=S, padx=[0,40])
b2=ttk.Button(text='Custom', style='bb.TButton')
b2.pack(side=RIGHT, anchor=S, padx=[20,0])

padding=1 padding=40

🌐
Narkive
comp.lang.tcl.narkive.com › 7piJqDx8 › how-to-change-the-font-and-font-size-in-ttk-button-themed-widgets
How to change the font and font size in ttk::button (themed widgets)?
Permalink Simple Questions (newbie here): [1] How do you change the font and font size in the themed button widget (ttk::button)? ttk::button .x.buttonTEST -text "TEST" -font??(option not valid with ttk::button) [2] Is there any method to change the height size of the ttk::button?
Top answer
1 of 2
1

Configuration of height is not supported in ttk.Button per Changing ttk Button Height in Python

However width is supported by ttk.Button.

I don't see where you are trying to add width in your example code, so I've taken two of the buttons (remove_button, and shuffle_button) and placed a width of 100 on remove_button.

<-SNIP->

remove_button = ttk.Button(window, text="Remove", width=100, command=remove_from_playlist)
shuffle_button = ttk.Button(window, text="Shuffle", command=shuffle_playlist)

<-SNIP->

In the future, you can see what config keys are supported for a tk widget with:

print(remove_button.config().keys())
# Supported config keys:
# dict_keys(['command', 'default', 'takefocus', 'text', 'textvariable', 'underline', 'width', 'image', 'compound', 'padding', 'state', 'cursor', 'style', 
'class'])

Additionally, for ttk widgets you can check what ttk.Style keys are supported for a specific ttk widget with:

print(ttk.Style().configure(remove_button.winfo_class()).keys())
# Supported Style config keys:
# dict_keys(['padding', 'anchor', 'width'])

where remove_button is the name of the widget you are querying. In this case, I am querying the remove_button key.

Image showing example code result

2 of 2
0

there are 2 options that you could do. ttk only has options to adjust the width for a button. if you change from ttk.Button to just Button you can set the height and width of your buttons on creation. however if you want to use ttk down in your grid instead of using padx=5, pady=10 you can use ipadx=10, ipady=30. that will set the internal padding of your buttons and can stretch and grow them as you need. but it will adjust the layout of the rest of your window and affect other items in the same columns/rows if they need to be diffent sizes