CheckButton's ON state while it is disabled
See original GitHub issueIs your feature request related to a problem? Please describe.
When setting the state
of a CheckButton
to DISABLED
, the “tick” disappears from the CheckButton
as its variable would have the offvalue
value.
A small reproducer:
import ttkbootstrap as ttk
app = ttk.Window()
frame = ttk.Frame(app)
frame.pack()
value = ttk.StringVar()
value.set("1")
ttk.Checkbutton(frame, text=f"Checkbutton", state=ttk.DISABLED, variable=value, onvalue="1", offvalue="0").pack()
app.mainloop()
Describe the solution you’d like
I would like a DISABLED
state for the CheckButton
that properly indicates the state of its value(properly grayed out when the state is on).
Describe alternatives you’ve considered
My workaround was not setting the CheckButton
to DISABLED
. Instead, I bound a callback function for the toggling. In the callback function, I set the bounded value manually to its previous value (if I want the button to be disabled) so the user feels like the button is actually disabled.
Additional context
No response
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
How to check the state (enabled/disabled) of a checkbox in ...
I have a program I am writing in Python and I'm having trouble with checking the state of a checkbox. I do NOT...
Read more >Make checkbox disabled based on case's state value
I created a custom widget to show cases in list view with checkboxes. I want to make the respective checkbox enabled only if...
Read more >How to disable checkbutton Tkinter (grey out)? - Tutorialspoint
We can make a widget either active or disabled whenever required. To disable the Checkbuttons widget, we have to set the state property...
Read more >Python Tkinter for GUI programs Checkbutton Check UnCheck ...
Enable or Disable Checkbutton. By using config we can manage the state option of the Checkbutton. Enable disable Checkbutton c1.config(state='disabled') # ...
Read more >Tkinter Checkbutton reading the Checked or Unchecked value ...
Tkinter Checkbutton reading the Checked or Unchecked value & setting the state to disabled or enable.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
light theme results
dark theme results
@israel-dryer, that’s pretty good, but I would prefer something like this: It gives me more the “disabled-selected” feeling.