How to change the text size of button widgets?

I searched all of Google and SO for something that could help me with this seemingly simple problem.

I have a button in Tkinter and I want its weight to be bold. I tried this:

test = Button(..., text="Test", font=("Arial",10,"bold"), command=...)

And this:

test = Button(..., text="Test", font="Arial 10 bold", command=...)

But both return errors unknown option -font.

Any help would be greatly appreciated.

+3
source share
1 answer

Can you cut and paste all the error you get? fontmost definitely an option for the tkinter Button class.

I assume that when you think that you are creating a tkinter button widget, you are creating something else - perhaps a ttk button widget that does not support the font attribute.

+3
source

All Articles