Replies: 1 comment 3 replies
-
Yes you can do this by modifying the style that you want to use on the checkbutton. Under the hood, a bootstyle is just a pre-defined ttk style; so you can subclass it to make your own. import ttkbootstrap as ttk
from ttkbootstrap.constants import *
# create a new window
app = ttk.Window(themename='flatly', size=(500, 400))
frame = ttk.Frame(app, bootstyle='primary', padding=10)
frame.pack(fill=X, padx=10, pady=10, side=TOP)
lbl = ttk.Label(frame, text='Search', bootstyle='primary-inverse')
lbl.pack(side=LEFT)
# create a custom style by subclassing an existing ttkbootstrap style
app.style.configure('my.secondary.TCheckbutton', background=app.style.colors.primary)
# create a checkbutton and apply the new style with the `style` argument
cb = ttk.Checkbutton(frame, style='my.secondary.TCheckbutton')
cb.pack(side=LEFT, padx=10)
app.mainloop() |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Is it possible to change the background color a checkbutton or make it the background transparent?
Also is it possible to increase the size of it?
currently changing the size only changes the background but the checkbox remains same
Current:
Goal:
Thanks
Beta Was this translation helpful? Give feedback.
All reactions