diff options
author | msimionato <msimionato@msimionato.uxmi.statnet.statpro.com> | 2010-05-10 17:27:53 +0200 |
---|---|---|
committer | msimionato <msimionato@msimionato.uxmi.statnet.statpro.com> | 2010-05-10 17:27:53 +0200 |
commit | bcfdacd57f45f049f9f54d7074389d0bf8e596f7 (patch) | |
tree | 59b8e9e3bd65381ed47964cf0e80717702957484 /pypers/pycon10/menu2.py | |
parent | b055201ebb7686783c0be59078a7bd540715c785 (diff) | |
download | micheles-bcfdacd57f45f049f9f54d7074389d0bf8e596f7.tar.gz |
Added my talks at PyConIt 2010
Diffstat (limited to 'pypers/pycon10/menu2.py')
-rw-r--r-- | pypers/pycon10/menu2.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pypers/pycon10/menu2.py b/pypers/pycon10/menu2.py new file mode 100644 index 0000000..d148389 --- /dev/null +++ b/pypers/pycon10/menu2.py @@ -0,0 +1,13 @@ +import Tkinter +root = Tkinter.Tk() +text = Tkinter.StringVar() +label = Tkinter.Label(root, textvariable=text) +menubar = Tkinter.Menu(root) +menu = Tkinter.Menu(menubar) +menubar.add_cascade(label='File', menu=menu) +for item in ['F1','F2', 'F3']: + def showmenu(item=item): + text.set(text.get() + '\n%s' % item) + menu.add_command(label=item, command=showmenu) +root.config(menu=menubar); label.pack() +root.mainloop() |