TomSchimansky / CustomTkinter

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

Idea: ctk_scrollable_frame widget Add option to add both: vertical and horizontal scrolls #1767

Open esaenzzu opened 1 year ago

esaenzzu commented 1 year ago

I'm developing an application where a I need an scrollable widget with horizontal and vertical scrolls This is the code I Had to add in /customtkinter/windows/widgets/ctk_scrollable_frame.py:

diff --git a/customtkinter/windows/widgets/ctk_scrollable_frame.py b/customtkinter/windows/widgets/ctk_scrollable_frame.py index 687f4ad..b802d67 100644 --- a/customtkinter/windows/widgets/ctk_scrollable_frame.py +++ b/customtkinter/windows/widgets/ctk_scrollable_frame.py @@ -36,7 +36,7 @@ class CTkScrollableFrame(tkinter.Frame, CTkAppearanceModeBaseClass, CTkScalingBa label_text: str = "", label_font: Optional[Union[tuple, CTkFont]] = None, label_anchor: str = "center",

@@ -57,6 +57,16 @@ class CTkScrollableFrame(tkinter.Frame, CTkAppearanceModeBaseClass, CTkScalingBa self._scrollbar = CTkScrollbar(master=self._parent_frame, orientation="vertical", command=self._parent_canvas.yview, fg_color=scrollbar_fg_color, button_color=scrollbar_button_color, button_hover_color=scrollbar_button_hover_color) self._parent_canvas.configure(yscrollcommand=self._scrollbar.set)

I tried to make a pull request but I could not

Akascape commented 1 year ago

You can also use this CTkXYFrame widget which have both horizontal and vertical scrollbars in the same frame.

Screenshot