diff --git a/customtkinter/draw_engine.py b/customtkinter/draw_engine.py index 43671cd..8d062d2 100644 --- a/customtkinter/draw_engine.py +++ b/customtkinter/draw_engine.py @@ -75,11 +75,16 @@ class DrawEngine: else: inner_corner_radius = 0 - if self.preferred_drawing_method == "polygon_shapes": + if overwrite_preferred_drawing_method is not None: + preferred_drawing_method = overwrite_preferred_drawing_method + else: + preferred_drawing_method = self.preferred_drawing_method + + if preferred_drawing_method == "polygon_shapes": return self.__draw_rounded_rect_with_border_polygon_shapes(width, height, corner_radius, border_width, inner_corner_radius) - elif self.preferred_drawing_method == "font_shapes": + elif preferred_drawing_method == "font_shapes": return self.__draw_rounded_rect_with_border_font_shapes(width, height, corner_radius, border_width, inner_corner_radius, ()) - elif self.preferred_drawing_method == "circle_shapes": + elif preferred_drawing_method == "circle_shapes": return self.__draw_rounded_rect_with_border_circle_shapes(width, height, corner_radius, border_width, inner_corner_radius) def __draw_rounded_rect_with_border_polygon_shapes(self, width: int, height: int, corner_radius: int, border_width: int, inner_corner_radius: int) -> bool: diff --git a/examples/example_background_image.py b/examples/example_background_image.py index e7b0292..5771843 100644 --- a/examples/example_background_image.py +++ b/examples/example_background_image.py @@ -23,6 +23,7 @@ class App(customtkinter.CTk): self.geometry(f"{App.WIDTH}x{App.HEIGHT}") self.minsize(App.WIDTH, App.HEIGHT) self.maxsize(App.WIDTH, App.HEIGHT) + self.resizable(False, False) self.protocol("WM_DELETE_WINDOW", self.on_closing) diff --git a/examples/simple_example.py b/examples/simple_example.py index f4cfa47..1973a49 100644 --- a/examples/simple_example.py +++ b/examples/simple_example.py @@ -56,8 +56,6 @@ radiobutton_1.pack(pady=y_padding, padx=10) radiobutton_2 = customtkinter.CTkRadioButton(master=frame_1, variable=radiobutton_var, value=2) radiobutton_2.pack(pady=y_padding, padx=10) -s_var = tkinter.StringVar(value="on") - switch_1 = customtkinter.CTkSwitch(master=frame_1) switch_1.pack(pady=y_padding, padx=10)