Descrizione
Banale esempio di GUI con menù in Python.
Codice
from Tkinter import *
def hello():
print "HelloWorld\n"
def about():
print "Codec by V3rgil\n";
mw = Tk()
mn = Menu(mw)
mw.config(menu=mn)
filemn = Menu(mn)
mn.add_cascade(label="File", menu=filemn)
filemn.add_command(label="Hello...", command=hello)
filemn.add_separator()
filemn.add_command(label="Esci", command=mw.quit)
helpmn = Menu(mn)
mn.add_cascade(label="Help", menu=helpmn)
helpmn.add_command(label="About...", command=about)
mainloop()
0 commenti:
Posta un commento