0
어떤 이유로 tkinter에서 창을 닫으면 다시 팝업됩니다. 그것을 고치는 법을 모릅니다. wait_window
이 있지만 작동하지 않는 것 같습니다.wait_window가 제대로 작동하지 않습니다.
import tkinter
class Othello:
def __init__(self, othello_game):
self.state = othello_game
self._root_window = tkinter.Tk()
self._root_window.title('Othello')
self._canvas = tkinter.Canvas(master=self._root_window,
width=800, height=800,
background='yellow')
self._canvas.grid(row=1, column=0, padx=1, pady=1)
self._root_window.rowconfigure(0, weight=1)
self._root_window.columnconfigure(0, weight=1)
self._root_window.wait_window()
def start(self) -> None:
self._root_window.mainloop()
if __name__ == '__main__':
while True:
start_game = Othello("othello_game")
start_game.start()
루트 창에서'wait_window()'를 호출하는 것은 의미가 없습니다. 정상적으로'mainloop'을 호출하면 창이 사라지 자마자 반환됩니다. –