- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to disable (grey out) a checkbutton in Tkinter?
Tkinter provides a variety of input widgets such as entry widget, text widget, listbox, combobox, spinbox, checkbox, etc. Checkboxes are used for taking validity input and the state gets active whenever the user clicks on the checkbutton. In terms of a particular application, we can enable and disable the state of CheckButtons by using the state property.
#Import the required library from tkinter import* from tkinter import ttk #Create an instance of tkinter frame win= Tk() #Set the geometry win.geometry("750x250") #Create CheckButtons chk= ttk.Checkbutton(win, text="Python") chk.pack() chk.config(state=DISABLED) win.mainloop()
Running the example code will display a window with a check button that is initially disabled.
We can change the state of the checkbuttons by changing the values of the state property to NORMAL or DISABLED.
- How to disable checkbutton Tkinter (grey out)?
- How to gray out (disable) a Tkinter Frame?
- How to disable a Combobox in Tkinter?
- How to Disable / Enable a Button in TKinter?
- Making Menu options with Checkbutton in Tkinter?
- How to detect when an OptionMenu or Checkbutton changes in Tkinter?
- How do I get the 'state' of a Tkinter Checkbutton?
- How to disable multiselection on Treeview in tkinter?
- How to disable an Entry widget in Tkinter?
- How can I disable typing in a ttk.Combobox tkinter?
- How to clear out a frame in the Tkinter?
- How to hide or disable the mouse pointer in Tkinter?
- Disable Exit (or [ X ]) in Tkinter Window
- How to disable back button in android while logging out the application?
- How to align checkbutton in ttk to the left side?