pythontkinterttk

How can I control the height of a ttk.Button?


With Tkinter, I can set the height of a button with something like
button = tkinter.Button(frame, text='hi', width=20, height=20...).

But in my program, I want to use a ttk button.
button = ttk.Button(frame, text='hi', width=20, height=20...) doesn't work - height doesn't seem to be a valid option. I couldn't find a way to set the height using config or by changing style elements, either.

How can I set the height of a ttk button explicitly?


Solution

  • The whole point of themed buttons is to provide a uniform size, so it can't be done directly. However, there's plenty of room for out-of-the-box thinking. For example:

    Of course, if you are on OSX all bets are off -- it really wants to make buttons a specific size.