自从4年前干过MFC,整天跟对话框打交道,后来就一直没有碰过了,有一种甚是怀念的感觉,突然用python几行代码堆了一个最简单的对话框,感觉萌萌哒~!
#!/usr/bin/env python
import Tkinter
top = Tkinter.Tk()
hello = Tkinter.Label(top, text = ‘Hello World!’)
hello.pack()
quit = Tkinter.Button(top, text = ‘QUIT’,
command = top.quit, bg = ‘red’, fg = ‘white’)
quit.pack(fill = Tkinter.X, expand = 1)
Tkinter.mainloop()