How to increase Checkbutton size – Tkinter

Question:

Is it possible to enlarge the tiny check box of the Checkbutton object? The size is out of proportion when increasing the text size. I searched through the following link (Checkbutton) and can’t find anything about the actual size of the box. Thank you for your help.

Asked By: Bonavia

||

Answers:

It is not possible to change the size of the checkbutton, but you can supply your own images. So, one solution is to create your own images at various sizes.

Answered By: Bryan Oakley

3 years late, but, now it’s possible. firstly, you need to find out what type the checkbutton is. we do that in the following way:

# making checkbutton
option_var = tk.StringVar()

checkbutton = ttk.Checkbutton(text='abc', variable = option_var, onvalue'hi', offvalue='bye')

checkbutton.pack()

# checking checkbutton style
print(checkbutton.winfo.class())
            

in most cases, the checkbutton style would be ‘TCheckbutton’.
all that’s left is to configure it

style = ttk.Style(root)
style.configure('TCheckbutton', font = 11)
Answered By: Red
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.