CustomTkinter
CustomTkinter copied to clipboard
Setting the state of CTk.RadioButton to DISABLED doesn't really make it disabled
When you configure the CTk.RadioButton's state as DISABLED, only hover effects and text color change. You can see it if you assign a function to the radio button when it's being clicked.
def clicked():
print("CLICKED!")
root = customtkinter.CTk()
button1= customtkinter.CTkRadioButton(master=root, width=20, height=20, text="Radio button", text_color="black", text_color_disabled="red", hover=True, hover_color="yellow", state=DISABLED, command= clicked)
button1.pack(fill=NONE, pady=11, padx=10, expand=False)
root.mainloop()
It'll print "CLICKED!" whenever you click the button even tho it's disabled.
First of all, why are you using Tk() instead of CTk() and second you can't just use DISABLED you have to use customtkinter.DISABLED.
Oh sorry, i didn't mean to write root = Tk(), i edited it out.
For the 'state' situation, in the docs it advises to use tkinter.DISABLED not customtkinter.DISABLED. (https://github.com/TomSchimansky/CustomTkinter/wiki/CTkRadioButton)
Yet I tried it out. Nothing changed, same result.
Its a bug, will be fixed in version 5.0.2