diff --git a/customtkinter/widgets/ctk_label.py b/customtkinter/widgets/ctk_label.py index 033841d..c60699b 100644 --- a/customtkinter/widgets/ctk_label.py +++ b/customtkinter/widgets/ctk_label.py @@ -119,7 +119,8 @@ class CTkLabel(CTkBaseClass): sticky=text_label_grid_sticky) if "text" in kwargs: - self.set_text(kwargs["text"]) + self.text = kwargs["text"] + self.text_label.configure(text=self.text) del kwargs["text"] if "fg_color" in kwargs: @@ -148,5 +149,7 @@ class CTkLabel(CTkBaseClass): self.text_label.configure(**kwargs) # pass remaining kwargs to label def set_text(self, text): + """ Will be removed in the next major release """ + self.text = text - self.text_label.configure(text=self.text, width=len(self.text)) + self.text_label.configure(text=self.text) diff --git a/test/manual_integration_tests/complex_example_new.py b/test/manual_integration_tests/complex_example_new.py index 5899aa4..53d1854 100644 --- a/test/manual_integration_tests/complex_example_new.py +++ b/test/manual_integration_tests/complex_example_new.py @@ -37,7 +37,7 @@ class App(customtkinter.CTk): self.appearance_mode_optionemenu = customtkinter.CTkOptionMenu(self.sidebar_frame, values=["Light", "Dark", "System"], command=self.change_appearance_mode) self.appearance_mode_optionemenu.grid(row=6, column=0, padx=20, pady=(10, 10)) - self.scaling_label = customtkinter.CTkLabel(self.sidebar_frame, text="Widget Scaling:", anchor="w") + self.scaling_label = customtkinter.CTkLabel(self.sidebar_frame, text="UI Scaling:", anchor="w") self.scaling_label.grid(row=7, column=0, padx=20, pady=(10, 0)) self.scaling_optionemenu = customtkinter.CTkOptionMenu(self.sidebar_frame, values=["80%", "90%", "100%", "110%", "120%"], command=self.change_scaling)