messagebox
是不可以调整搭御大小的。如果你需孝枝戚要的话,你可以换其巧陵他的来实现,下面是一个例子。
from
tkinter
import
*
#If
you
get
an
error
here,
try
Tkinter
not
tkinter
def
Dialog1Display():
Dialog1
=
Toplevel(height=100,
width=100)
#Here
def
Dialog2Display():
Dialog2
=
Toplevel(height=1000,
width=1000)
#Here
master=Tk()
Button1
=
Button(master,
text="Small",
command=Dialog1Display)
Button2
=
Button(master,
text="Big",
command=Dialog2Display)
Button1.pack()
Button2.pack()
master.mainloop()
你好,你的self.root是在init函数里面才定义的class本身没有root这个成员,你可以将孝行闭self.root那行删除。然后在class windows里面增加一个带键对root的巧裂定义
root = tkinter.Tk()
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)