diff --git a/customtkinter/windows/widgets/core_widget_classes/ctk_base_class.py b/customtkinter/windows/widgets/core_widget_classes/ctk_base_class.py index 610f46a..009b5dc 100644 --- a/customtkinter/windows/widgets/core_widget_classes/ctk_base_class.py +++ b/customtkinter/windows/widgets/core_widget_classes/ctk_base_class.py @@ -2,7 +2,7 @@ import sys import warnings import tkinter import tkinter.ttk as ttk -from typing import Union, Callable, Tuple +from typing import Union, Callable, Tuple, Optional try: from typing import TypedDict @@ -35,10 +35,12 @@ class CTkBaseClass(tkinter.Frame, CTkAppearanceModeBaseClass, CTkScalingBaseClas height: int = 0, bg_color: Union[str, Tuple[str, str]] = "transparent", + + name: Optional[str] = None, **kwargs): # call init methods of super classes - tkinter.Frame.__init__(self, master=master, width=width, height=height, **pop_from_dict_by_set(kwargs, self._valid_tk_frame_attributes)) + tkinter.Frame.__init__(self, master=master, width=width, height=height, name=name, **pop_from_dict_by_set(kwargs, self._valid_tk_frame_attributes)) CTkAppearanceModeBaseClass.__init__(self) CTkScalingBaseClass.__init__(self, scaling_type="widget") diff --git a/customtkinter/windows/widgets/ctk_button.py b/customtkinter/windows/widgets/ctk_button.py index d79a944..9ba9514 100644 --- a/customtkinter/windows/widgets/ctk_button.py +++ b/customtkinter/windows/widgets/ctk_button.py @@ -46,10 +46,12 @@ class CTkButton(CTkBaseClass): command: Union[Callable[[], None], None] = None, compound: str = "left", anchor: str = "center", + + name: Optional[str] = None, **kwargs): # transfer basic functionality (bg_color, size, appearance_mode, scaling) to CTkBaseClass - super().__init__(master=master, bg_color=bg_color, width=width, height=height, **kwargs) + super().__init__(master=master, bg_color=bg_color, width=width, height=height, name=name, **kwargs) # shape self._corner_radius: int = ThemeManager.theme["CTkButton"]["corner_radius"] if corner_radius is None else corner_radius diff --git a/customtkinter/windows/widgets/ctk_frame.py b/customtkinter/windows/widgets/ctk_frame.py index 67bf161..a9ae37d 100644 --- a/customtkinter/windows/widgets/ctk_frame.py +++ b/customtkinter/windows/widgets/ctk_frame.py @@ -27,10 +27,12 @@ class CTkFrame(CTkBaseClass): background_corner_colors: Union[Tuple[Union[str, Tuple[str, str]]], None] = None, overwrite_preferred_drawing_method: Union[str, None] = None, + + name: Optional[str] = None, **kwargs): # transfer basic functionality (_bg_color, size, __appearance_mode, scaling) to CTkBaseClass - super().__init__(master=master, bg_color=bg_color, width=width, height=height, **kwargs) + super().__init__(master=master, bg_color=bg_color, width=width, height=height, name=name, **kwargs) # color self._border_color = ThemeManager.theme["CTkFrame"]["border_color"] if border_color is None else self._check_color_type(border_color)