From 32dacb3200534656a755ec8218b2725fa01b699f Mon Sep 17 00:00:00 2001 From: octimot Date: Mon, 5 Jun 2023 13:19:29 +0200 Subject: [PATCH] Added name attribute to CTkScrollableFrame Fixed CTkLabel name attribute --- customtkinter/windows/widgets/ctk_label.py | 2 +- customtkinter/windows/widgets/ctk_scrollable_frame.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/customtkinter/windows/widgets/ctk_label.py b/customtkinter/windows/widgets/ctk_label.py index 1203ea6..f3abc1e 100644 --- a/customtkinter/windows/widgets/ctk_label.py +++ b/customtkinter/windows/widgets/ctk_label.py @@ -20,7 +20,7 @@ class CTkLabel(CTkBaseClass): # attributes that are passed to and managed by the tkinter entry only: _valid_tk_label_attributes = {"cursor", "justify", "padx", "pady", - "textvariable", "state", "takefocus", "underline"} + "textvariable", "state", "takefocus", "underline", "name"} def __init__(self, master: any, diff --git a/customtkinter/windows/widgets/ctk_scrollable_frame.py b/customtkinter/windows/widgets/ctk_scrollable_frame.py index 687f4ad..eafa075 100644 --- a/customtkinter/windows/widgets/ctk_scrollable_frame.py +++ b/customtkinter/windows/widgets/ctk_scrollable_frame.py @@ -36,7 +36,8 @@ class CTkScrollableFrame(tkinter.Frame, CTkAppearanceModeBaseClass, CTkScalingBa label_text: str = "", label_font: Optional[Union[tuple, CTkFont]] = None, label_anchor: str = "center", - orientation: Literal["vertical", "horizontal"] = "vertical"): + orientation: Literal["vertical", "horizontal"] = "vertical", + name: Optional[str] = None): self._orientation = orientation @@ -45,7 +46,8 @@ class CTkScrollableFrame(tkinter.Frame, CTkAppearanceModeBaseClass, CTkScalingBa self._desired_height = height self._parent_frame = CTkFrame(master=master, width=0, height=0, corner_radius=corner_radius, - border_width=border_width, bg_color=bg_color, fg_color=fg_color, border_color=border_color) + border_width=border_width, bg_color=bg_color, fg_color=fg_color, + border_color=border_color, name=name) self._parent_canvas = tkinter.Canvas(master=self._parent_frame, highlightthickness=0) self._set_scroll_increments()