1
Tkinter 참조에서 알 수 있듯이 부모 윈도우에 임시 자식 윈도우가 그려져 있습니다. 이 기능은 Linux에서는 작동하지만 Windows에서는 작동하지 않습니다 (7).Python 2.7/Windows 7/Tkinter : 부모 오버플로 센터 임시 윈도우
이 문제가 발생하는 이유는 무엇입니까?
.geometry() 메소드를 사용하여 수동으로 창 중앙에 배치 할 수 있지만 GUI가 몇 가지 값 (1 초)을 계산할 때 GUI가없는 작은 창이 나타나며 지정된 값으로 넘어갑니다 .withdraw 메서드를 호출 할 때조차도
고맙습니다.
# -*- coding: utf-8 -*-
import Tkinter as tk
import ttk
class Parent(tk.Tk):
def __init__(self, *args, **kwargs):
tk.Tk.__init__(self, *args, **kwargs)
self.txt = tk.Text(master=self)
self.txt.pack()
self.btn = ttk.Button(master=self, text='Show Child',
command=self.show)
self.btn.pack()
self.mainloop()
def show(self, *args):
Child(self)
class Child(tk.Toplevel):
def __init__(self, master, *args, **kwargs):
tk.Toplevel.__init__(self, *args, **kwargs)
self.txt = tk.Text(master=self)
self.txt.pack()
Parent()