CustomTkinter icon indicating copy to clipboard operation
CustomTkinter copied to clipboard

Cannot set state argument with CTkTextbox.config() / CTkTextbox.configure()

Open avalon60 opened this issue 2 years ago • 5 comments

Trying to toggle between CTkTextbox being normal and disabled.

CTkTextbox.config does not recognise the "state" argument:

image

avalon60 avatar Jul 30 '22 14:07 avalon60

You're using tk.DISABLED which isnt supported by CTk, thus you have to pass "disabled" or "normal" as a string to state

TheFallen-Cat avatar Jul 30 '22 15:07 TheFallen-Cat

@TheFallen-Cat that makes no difference, the value of tk.DISABLED resolves to "disabled", and if you look at the error, it's "-state" that it's balking on. The textbox code actually uses tkinter, under the hood, so it would be logical to assumed that tk.DISABLED should work, for consistency.

Besides, I tried using a literal, "disabled" prior:

image

The amber underscores on the PyCharm display indicate that the state argument is unexpected. Finally, if you look at the code, you can see that when the widget is created, it quite happily accepts the tk.DISABLED.

avalon60 avatar Jul 31 '22 11:07 avalon60

There are many things that are not working for the CTkTextbox. It isn't completed yet.

TomSchimansky avatar Jul 31 '22 12:07 TomSchimansky

Hi @TomSchimansky. I have submitted a solution for your review - it's a two line fix.

avalon60 avatar Jul 31 '22 13:07 avalon60

@avalon60 Is it solved? I think if you want to configure the state you might want to use .configure() instead of .config()

lmwenda avatar Aug 04 '22 12:08 lmwenda

Works now with version 5.0.0.

TomSchimansky avatar Dec 04 '22 20:12 TomSchimansky