Added name attribute to CTkScrollableFrame

Fixed CTkLabel name attribute
This commit is contained in:
octimot 2023-06-05 13:19:29 +02:00
parent 6bbece9e76
commit 32dacb3200
2 changed files with 5 additions and 3 deletions

View File

@ -20,7 +20,7 @@ class CTkLabel(CTkBaseClass):
# attributes that are passed to and managed by the tkinter entry only: # attributes that are passed to and managed by the tkinter entry only:
_valid_tk_label_attributes = {"cursor", "justify", "padx", "pady", _valid_tk_label_attributes = {"cursor", "justify", "padx", "pady",
"textvariable", "state", "takefocus", "underline"} "textvariable", "state", "takefocus", "underline", "name"}
def __init__(self, def __init__(self,
master: any, master: any,

View File

@ -36,7 +36,8 @@ class CTkScrollableFrame(tkinter.Frame, CTkAppearanceModeBaseClass, CTkScalingBa
label_text: str = "", label_text: str = "",
label_font: Optional[Union[tuple, CTkFont]] = None, label_font: Optional[Union[tuple, CTkFont]] = None,
label_anchor: str = "center", label_anchor: str = "center",
orientation: Literal["vertical", "horizontal"] = "vertical"): orientation: Literal["vertical", "horizontal"] = "vertical",
name: Optional[str] = None):
self._orientation = orientation self._orientation = orientation
@ -45,7 +46,8 @@ class CTkScrollableFrame(tkinter.Frame, CTkAppearanceModeBaseClass, CTkScalingBa
self._desired_height = height self._desired_height = height
self._parent_frame = CTkFrame(master=master, width=0, height=0, corner_radius=corner_radius, 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._parent_canvas = tkinter.Canvas(master=self._parent_frame, highlightthickness=0)
self._set_scroll_increments() self._set_scroll_increments()