diff --git a/customtkinter/widgets/ctk_button.py b/customtkinter/widgets/ctk_button.py index 93be937..87a0ec5 100644 --- a/customtkinter/widgets/ctk_button.py +++ b/customtkinter/widgets/ctk_button.py @@ -166,6 +166,9 @@ class CTkButton(CTkBaseClass): self._text_label = tkinter.Label(master=self, font=self._apply_font_scaling(self._font), text=self._text, + padx=0, + pady=0, + borderwidth=1, textvariable=self._textvariable) self._text_label.bind("", self._on_enter) diff --git a/customtkinter/widgets/ctk_label.py b/customtkinter/widgets/ctk_label.py index 00fc555..06ad8c1 100644 --- a/customtkinter/widgets/ctk_label.py +++ b/customtkinter/widgets/ctk_label.py @@ -62,11 +62,13 @@ class CTkLabel(CTkBaseClass): self._text_label = tkinter.Label(master=self, highlightthickness=0, - bd=0, + padx=0, + pady=0, + borderwidth=1, anchor=self._anchor, text=self._text, - font=self._apply_font_scaling(self._font), - **pop_from_dict_by_set(kwargs, self._valid_tk_label_attributes)) + font=self._apply_font_scaling(self._font)) + self._text_label.configure(**pop_from_dict_by_set(kwargs, self._valid_tk_label_attributes)) text_label_grid_sticky = self._anchor if self._anchor != "center" else "" self._text_label.grid(row=0, column=0, sticky=text_label_grid_sticky, diff --git a/customtkinter/widgets/ctk_optionmenu.py b/customtkinter/widgets/ctk_optionmenu.py index 1374e52..b6ab891 100644 --- a/customtkinter/widgets/ctk_optionmenu.py +++ b/customtkinter/widgets/ctk_optionmenu.py @@ -101,6 +101,9 @@ class CTkOptionMenu(CTkBaseClass): self._text_label = tkinter.Label(master=self, font=self._apply_font_scaling(self._font), anchor="w", + padx=0, + pady=0, + borderwidth=1, text=self._current_value) self._text_label.grid(row=0, column=0, sticky="w", padx=(max(self._apply_widget_scaling(self._corner_radius), self._apply_widget_scaling(3)), diff --git a/customtkinter/widgets/widget_base_class.py b/customtkinter/widgets/widget_base_class.py index 9289d10..40610a9 100644 --- a/customtkinter/widgets/widget_base_class.py +++ b/customtkinter/widgets/widget_base_class.py @@ -241,7 +241,6 @@ class CTkBaseClass(tkinter.Frame): raise ValueError(f"'{attribute_name}' is not a supported argument. Look at the documentation for supported arguments.") def _update_dimensions_event(self, event): - print(event) # only redraw if dimensions changed (for performance), independent of scaling if round(self._current_width) != round(event.width / self._widget_scaling) or round(self._current_height) != round(event.height / self._widget_scaling): self._current_width = (event.width / self._widget_scaling) # adjust current size according to new size given by event diff --git a/customtkinter/windows/ctk_tk.py b/customtkinter/windows/ctk_tk.py index 0988c77..98777a2 100644 --- a/customtkinter/windows/ctk_tk.py +++ b/customtkinter/windows/ctk_tk.py @@ -180,7 +180,7 @@ class CTk(tkinter.Tk): self._current_width = max(self._min_width, min(width, self._max_width)) # bound value between min and max self._current_height = max(self._min_height, min(height, self._max_height)) else: - return self.reverse_geometry_scaling(super().geometry()) + return self._reverse_geometry_scaling(super().geometry()) @staticmethod def _parse_geometry_string(geometry_string: str) -> tuple: diff --git a/test/manual_integration_tests/complex_example_new.py b/test/manual_integration_tests/complex_example_new.py index 36d168e..14b2ebe 100644 --- a/test/manual_integration_tests/complex_example_new.py +++ b/test/manual_integration_tests/complex_example_new.py @@ -138,8 +138,6 @@ class App(customtkinter.CTk): self.seg_button_1.configure(values=["CTkSegmentedButton", "Value 2", "Value 3"]) self.seg_button_1.set("Value 2") - self.radiobutton_frame.configure(border_width=50) - def open_input_dialog(self): dialog = customtkinter.CTkInputDialog(master=self, text="Type in a number:", title="CTkInputDialog") print("CTkInputDialog:", dialog.get_input()) diff --git a/test/manual_integration_tests/test_tabview.py b/test/manual_integration_tests/test_tabview.py index c205b84..8afabf2 100644 --- a/test/manual_integration_tests/test_tabview.py +++ b/test/manual_integration_tests/test_tabview.py @@ -5,10 +5,10 @@ app = customtkinter.CTk() tabview_1 = customtkinter._CTkTabview(app) tabview_1.pack(padx=20, pady=20) tabview_1.add("tab 1") -tabview_1.insert(0, "tab 0 g |ß$§") +tabview_1.insert(0, "tab 0 g |ß$§ 😀") app.update() -tabview_1._segmented_button._buttons_dict["tab 0 g |ß$§"]._text_label.configure(padx=0, pady=0, bd=0) -tabview_1._segmented_button._buttons_dict["tab 0 g |ß$§"]._text_label.configure(bg="red") +tabview_1._segmented_button._buttons_dict["tab 0 g |ß$§ 😀"]._text_label.configure(padx=0, pady=0, bd=1) +tabview_1._segmented_button._buttons_dict["tab 0 g |ß$§ 😀"]._text_label.configure(bg="red") app.mainloop()