CustomTkinter icon indicating copy to clipboard operation
CustomTkinter copied to clipboard

Setting the state of CTk.RadioButton to DISABLED doesn't really make it disabled

Open duruburak opened this issue 3 years ago • 2 comments

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.

duruburak avatar Nov 28 '22 15:11 duruburak

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.

TheFallen-Cat avatar Nov 28 '22 16:11 TheFallen-Cat

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.

duruburak avatar Nov 28 '22 17:11 duruburak

Its a bug, will be fixed in version 5.0.2

TomSchimansky avatar Dec 01 '22 21:12 TomSchimansky