CustomTkinter
CustomTkinter copied to clipboard
Cannot set state argument with CTkTextbox.config() / CTkTextbox.configure()
Trying to toggle between CTkTextbox being normal and disabled.
CTkTextbox.config does not recognise the "state" argument:
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 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:
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.
There are many things that are not working for the CTkTextbox. It isn't completed yet.
Hi @TomSchimansky. I have submitted a solution for your review - it's a two line fix.
@avalon60 Is it solved? I think if you want to configure the state you might want to use .configure() instead of .config()
Works now with version 5.0.0.