Skip to content

Error message when creating a window after closing a previous window if the code is running in cmd or Visual Studio Code #2752

@wyu100

Description

@wyu100

When I run this code:

import customtkinter as ctk
window=ctk.CTk()
window.mainloop()
window=ctk.CTk()
window.mainloop()

In Idle there's no problem, but when I run it in Visual Studio Code or Windows command prompt I get this error:

invalid command name "2469118395776update"
    while executing
"2469118395776update"
    ("after" script)

I think this is a bug, but I could be wrong. Thanks in advance for your help!

Edit:
It appears to be a windows related bug that still needs to be fixed!

A little more info about where the error message is coming from:

in windows ctk_tk.py: class CTk __init__
it calls:

self._windows_set_titlebar_color(self._get_appearance_mode()) line 78

which later calls: super().update() on line 283 resulting in the error message I mentioned earlier!

I don't know what code is required to fix it though! I just thought I might provide a little more helpful information about what's going on!

Edit 2:
This code also generates the error message:

import tkinter as tk
import customtkinter as ctk
window=ctk.CTk()
window.mainloop()
tk.Tk()
tk.mainloop()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions