Closed joe00271 closed 3 days ago
It is an implementation lack. The ScrollableFrame does not have an option to update Scrollbar visibility afterwords.
For instant fix, I created following function for you:
from customtkinter import CTkScrollableFrame, CTkButton
from tkinter import Tk
def toggle_scrollbar(s_frame):
s_frame.update_idletasks()
if s_frame._scrollbar.winfo_ismapped():
s_frame._scrollbar.grid_remove()
else:
s_frame._scrollbar.grid()
if __name__ == "__main__":
app = Tk()
s_frame = CTkScrollableFrame(app, fg_color="lightblue", width=600, height=400)
s_frame.pack(padx=50, pady=50)
button = CTkButton(app, text="Toggle scrollbar", command=lambda: toggle_scrollbar(s_frame))
button.pack(padx=50, pady=50)
app.mainloop()
This will be helpful. Regards.
@dipeshSam thank's that 's working
@joe00271 Continue your great Tkinter journey. You are welcome. 😊
I want to disable the scroolbar when the content is to small i but i got this error
ValueError: ['scrollbar'] are not supported arguments. Look at the documentation for supported arguments. How to disable the scroolbar ?