question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Larger button text and tab text size

See original GitHub issue

Is it possible to increase the ttk.Button text size and ttk.Notebook tab size while still using the standard ttkbootstrap styling?

It seems like it should be an easy thing to achieve, but I can’t for the life of me figure out how.

Many thanks, Andrew

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
israel-dryercommented, Jan 11, 2022

yes, you can configure the underlying ttk style.

Here is the starting example of a button with a success bootstyle applied.

import ttkbootstrap as ttk

app = ttk.Window()

btn = ttk.Button(text='Push Button', bootstyle='success')
btn.pack(padx=10, pady=10)

app.mainloop()
python_BqERfULq7w

To find the ttk style used by the widget:

>>> btn.cget('style')
'success.TButton'

Change the font size on all buttons with the widget style ‘success.TButton’

# use 'None' for the font name if you only want to change the size
app.style.configure('success.TButton', font=(None, 25))
python_pdI4QTSHxP

Change the font size on ONLY this button using a subclassed style

# create the new style
app.style.configure('my.success.TButton', font=(None, 25))

# add the custom style to the button
btn.configure(style='my.success.TButton')

Change the font size on ALL buttons

app.style.configure('TButton', font=(None, 25))
1reaction
andrewguycommented, Jan 11, 2022

Thanks @israel-dryer for the super quick and very helpful response. This is great!

I’ll close this issue as you’ve answered my question, but I also want to say a huge thanks for the development of the ttkbootstrap tool. Really excellent work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change the font size of a button with CSS - Tutorialspoint
To change the font size of a button, use the font-size property. You can try to run the following code to change the...
Read more >
Make text and apps bigger - Microsoft Support
If the text size feels too small when navigating through Windows, you can make the text bigger. This affects, for example, title bars,...
Read more >
how to Change font size, Without changing the size of button ...
To change the text size without changing the button size, you would need to fix the size of the button. This can be...
Read more >
text-size-adjust - CSS: Cascading Style Sheets - MDN Web Docs
The text-size-adjust CSS property controls the text inflation algorithm used on some smartphones and tablets. Other browsers will ignore ...
Read more >
How to Increase Font Size in Chrome, Edge, Firefox, and Opera
Click the drop-down for Font size and select Large or Very Large to increase the text size. Click on the Customize fonts button...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found