Skip to content

Commit

Permalink
修复单例设计模式带来的无法重新打开窗口的Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Sisyphean-a committed Sep 26, 2023
1 parent d01c818 commit da96845
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions setting_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def __init__(self, parent):
x = parent.winfo_x() + 90
y = parent.winfo_y() + 200
self.window.geometry(f"300x260+{x}+{y}")
self.window.protocol("WM_DELETE_WINDOW", self.on_close)

# AccessKey ID组件
self.access_key_id_label = ttk.Label(self.window, text="AccessKey ID:")
Expand Down Expand Up @@ -122,4 +123,8 @@ def select_folder(self):
self.download_url_entry.insert(0, path)

self.window.attributes("-topmost", True)

def on_close(self):
self.window.destroy()
type(self)._instance = None

0 comments on commit da96845

Please sign in to comment.