mirror of
https://github.com/TomSchimansky/CustomTkinter.git
synced 2023-08-10 21:13:13 +03:00
name support for CTkEntry, CTkLabel, CTkTextbox
This commit is contained in:
parent
f39ee5764a
commit
b04ff1ae6b
@ -24,10 +24,12 @@ class CTkEntry(CTkBaseClass):
|
||||
**kwargs):
|
||||
|
||||
# transfer basic functionality (bg_color, size, _appearance_mode, scaling) to CTkBaseClass
|
||||
if "master" in kwargs:
|
||||
super().__init__(*args, bg_color=bg_color, width=width, height=height, master=kwargs.pop("master"))
|
||||
else:
|
||||
super().__init__(*args, bg_color=bg_color, width=width, height=height)
|
||||
super_kwargs = {}
|
||||
if "master" in kwargs:
|
||||
super_kwargs['master'] = kwargs.pop("master")
|
||||
if "name" in kwargs:
|
||||
super_kwargs['name'] = kwargs.pop("name")
|
||||
super().__init__(*args, bg_color=bg_color, width=width, height=height,**super_kwargs)
|
||||
|
||||
# configure grid system (1x1)
|
||||
self.grid_rowconfigure(0, weight=1)
|
||||
|
@ -21,11 +21,12 @@ class CTkLabel(CTkBaseClass):
|
||||
**kwargs):
|
||||
|
||||
# transfer basic functionality (bg_color, size, _appearance_mode, scaling) to CTkBaseClass
|
||||
if "master" in kwargs:
|
||||
super().__init__(*args, bg_color=bg_color, width=width, height=height, master=kwargs.pop("master"))
|
||||
else:
|
||||
super().__init__(*args, bg_color=bg_color, width=width, height=height)
|
||||
|
||||
super_kwargs = {}
|
||||
if "master" in kwargs:
|
||||
super_kwargs['master'] = kwargs.pop("master")
|
||||
if "name" in kwargs:
|
||||
super_kwargs['name'] = kwargs.pop("name")
|
||||
super().__init__(*args, bg_color=bg_color, width=width, height=height,**super_kwargs)
|
||||
# color
|
||||
self.fg_color = ThemeManager.theme["color"]["label"] if fg_color == "default_theme" else fg_color
|
||||
if self.fg_color is None:
|
||||
|
@ -20,10 +20,12 @@ class CTkTextbox(CTkBaseClass):
|
||||
**kwargs):
|
||||
|
||||
# transfer basic functionality (bg_color, size, _appearance_mode, scaling) to CTkBaseClass
|
||||
if "master" in kwargs:
|
||||
super().__init__(*args, bg_color=bg_color, width=width, height=height, master=kwargs.pop("master"))
|
||||
else:
|
||||
super().__init__(*args, bg_color=bg_color, width=width, height=height)
|
||||
super_kwargs = {}
|
||||
if "master" in kwargs:
|
||||
super_kwargs['master'] = kwargs.pop("master")
|
||||
if "name" in kwargs:
|
||||
super_kwargs['name'] = kwargs.pop("name")
|
||||
super().__init__(*args, bg_color=bg_color, width=width, height=height,**super_kwargs)
|
||||
|
||||
# color
|
||||
self.fg_color = ThemeManager.theme["color"]["entry"] if fg_color == "default_theme" else fg_color
|
||||
@ -166,4 +168,4 @@ class CTkTextbox(CTkBaseClass):
|
||||
else:
|
||||
super().configure(require_redraw=require_redraw)
|
||||
|
||||
self.textbox.configure(**kwargs)
|
||||
self.textbox.configure(**kwargs)
|
Loading…
Reference in New Issue
Block a user