TomSchimansky / CustomTkinter

A modern and customizable python UI-library based on Tkinter
MIT License
11.64k stars 1.09k forks source link

Attempt to configure textbox scrollbar resuts in error #2488

Closed TotalHelix closed 4 months ago

TotalHelix commented 5 months ago

When trying to use .configure() on a CTkTextbox to disable or enable the scrollbars, CustomTkinter raises an error saying that it isn't a valid argument.

Code to replicate:

import customtkinter as ctk

root = ctk.CTk()

textbox = ctk.CTkTextbox(root, activate_scrollbars=False)
textbox.pack()
textbox.configure(activate_scrollbars=True)

root.mainloop()

Output:

ValueError: ['activate_scrollbars'] are not supported arguments. Look at the documentation for supported arguments.

If this is intentional, could someone please explain why this doesn't or can't work?

Vv1234321vv commented 5 months ago

For scrollbars on a CTkTextbox in CustomTkinter, you need to set the activate_scrollbars parameter during the widget's initialization. This parameter cannot be changed afterward using the .configure() method.

`import customtkinter as ctk

root = ctk.CTk() textbox = ctk.CTkTextbox(root) textbox.pack()

root.mainloop()`

that should work in making what you wanted unless i am misunderstanding the problem

TotalHelix commented 5 months ago

In my full program, the scrollbar state is configured later depending on other inputs, but I was able to find a workaround by creating a new textbox each tim I need to change it. My main question is what property of scrollbars or textboxes prevents them from being configured?