From fb600c9811f89d9c7260ade10cfd6554488f61ba Mon Sep 17 00:00:00 2001 From: TomSchimansky Date: Wed, 21 Sep 2022 09:35:21 +0200 Subject: [PATCH] fixed resizable call for CTkToplevel shortly after toplevel creation --- customtkinter/windows/ctk_toplevel.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/customtkinter/windows/ctk_toplevel.py b/customtkinter/windows/ctk_toplevel.py index 4291ad2..d22567a 100644 --- a/customtkinter/windows/ctk_toplevel.py +++ b/customtkinter/windows/ctk_toplevel.py @@ -164,9 +164,9 @@ class CTkToplevel(tkinter.Toplevel): if sys.platform.startswith("win"): if self.appearance_mode == 1: - self.windows_set_titlebar_color("dark") + self.after(10, lambda: self.windows_set_titlebar_color("dark")) else: - self.windows_set_titlebar_color("light") + self.after(10, lambda: self.windows_set_titlebar_color("light")) def minsize(self, width=None, height=None): self.min_width = width @@ -289,6 +289,7 @@ class CTkToplevel(tkinter.Toplevel): elif self.iconify_called_after_windows_set_titlebar_color: super().iconify() else: + print("toplevel revert withdraw", self.state_before_windows_set_titlebar_color) if self.state_before_windows_set_titlebar_color == "normal": self.deiconify() elif self.state_before_windows_set_titlebar_color == "iconic":