/usr/lib64/python2.6/Demo/tkinter/matt
NameSizeModeActions
00-HELLO-WORLD.py7240644editdlrm
00-HELLO-WORLD.pyc12990644editdlrm
00-HELLO-WORLD.pyo12990644editdlrm
animation-simple.py9390644editdlrm
animation-simple.pyc17200644editdlrm
animation-simple.pyo17200644editdlrm
animation-w-velocity-ctrl.py12010644editdlrm
animation-w-velocity-ctrl.pyc20270644editdlrm
animation-w-velocity-ctrl.pyo20270644editdlrm
bind-w-mult-calls-p-type.py15500644editdlrm
bind-w-mult-calls-p-type.pyc14010644editdlrm
bind-w-mult-calls-p-type.pyo14010644editdlrm
canvas-demo-simple.py7480644editdlrm
canvas-demo-simple.pyc14210644editdlrm
canvas-demo-simple.pyo14210644editdlrm
canvas-gridding.py22710644editdlrm
canvas-gridding.pyc23260644editdlrm
canvas-gridding.pyo23260644editdlrm
canvas-moving-or-creating.py24220644editdlrm
canvas-moving-or-creating.pyc25850644editdlrm
canvas-moving-or-creating.pyo25850644editdlrm
canvas-moving-w-mouse.py21260644editdlrm
canvas-moving-w-mouse.pyc24730644editdlrm
canvas-moving-w-mouse.pyo24730644editdlrm
canvas-mult-item-sel.py28410644editdlrm
canvas-mult-item-sel.pyc28080644editdlrm
canvas-mult-item-sel.pyo28080644editdlrm
canvas-reading-tag-info.py16780644editdlrm
canvas-reading-tag-info.pyc18600644editdlrm
canvas-reading-tag-info.pyo18600644editdlrm
canvas-w-widget-draw-el.py11780644editdlrm
canvas-w-widget-draw-el.pyc15050644editdlrm
canvas-w-widget-draw-el.pyo15050644editdlrm
canvas-with-scrollbars.py21080644editdlrm
canvas-with-scrollbars.pyc23630644editdlrm
canvas-with-scrollbars.pyo23630644editdlrm
dialog-box.py24400644editdlrm
dialog-box.pyc19780644editdlrm
dialog-box.pyo19780644editdlrm
entry-simple.py7290644editdlrm
entry-simple.pyc10760644editdlrm
entry-simple.pyo10760644editdlrm
entry-with-shared-variable.py17470644editdlrm
entry-with-shared-variable.pyc16400644editdlrm
entry-with-shared-variable.pyo16400644editdlrm
killing-window-w-wm.py12950644editdlrm
killing-window-w-wm.pyc14930644editdlrm
killing-window-w-wm.pyo14930644editdlrm
menu-all-types-of-entries.py91100644editdlrm
menu-all-types-of-entries.pyc49710644editdlrm
menu-all-types-of-entries.pyo49710644editdlrm
menu-simple.py32510644editdlrm
menu-simple.pyc19610644editdlrm
menu-simple.pyo19610644editdlrm
not-what-you-might-think-1.py6750644editdlrm
not-what-you-might-think-1.pyc13000644editdlrm
not-what-you-might-think-1.pyo13000644editdlrm
not-what-you-might-think-2.py7470644editdlrm
not-what-you-might-think-2.pyc13350644editdlrm
not-what-you-might-think-2.pyo13350644editdlrm
packer-and-placer-together.py12090644editdlrm
packer-and-placer-together.pyc13880644editdlrm
packer-and-placer-together.pyo13880644editdlrm
packer-simple.py8190644editdlrm
packer-simple.pyc14240644editdlrm
packer-simple.pyo14240644editdlrm
placer-simple.py10780644editdlrm
placer-simple.pyc12930644editdlrm
placer-simple.pyo12930644editdlrm
pong-demo-1.py15490644editdlrm
pong-demo-1.pyc21340644editdlrm
pong-demo-1.pyo21340644editdlrm
printing-coords-of-items.py24000644editdlrm
printing-coords-of-items.pyc25840644editdlrm
printing-coords-of-items.pyo25840644editdlrm
radiobutton-simple.py20110644editdlrm
radiobutton-simple.pyc18640644editdlrm
radiobutton-simple.pyo18640644editdlrm
README5130644editdlrm
rubber-band-box-demo-1.py21340644editdlrm
rubber-band-box-demo-1.pyc25720644editdlrm
rubber-band-box-demo-1.pyo25720644editdlrm
rubber-line-demo-1.py19190644editdlrm
rubber-line-demo-1.pyc22760644editdlrm
rubber-line-demo-1.pyo22760644editdlrm
slider-demo-1.py10000644editdlrm
slider-demo-1.pyc17120644editdlrm
slider-demo-1.pyo17120644editdlrm
subclass-existing-widgets.py6770644editdlrm
subclass-existing-widgets.pyc12340644editdlrm
subclass-existing-widgets.pyo12340644editdlrm
two-radio-groups.py37580644editdlrm
two-radio-groups.pyc21920644editdlrm
two-radio-groups.pyo21920644editdlrm
window-creation-more.py10200644editdlrm
window-creation-more.pyc17190644editdlrm
window-creation-more.pyo17190644editdlrm
window-creation-simple.py8150644editdlrm
window-creation-simple.pyc16420644editdlrm
window-creation-simple.pyo16420644editdlrm
window-creation-w-location.py13250644editdlrm
window-creation-w-location.pyc21040644editdlrm
window-creation-w-location.pyo21040644editdlrm
Edit: /usr/lib64/python2.6/Demo/tkinter/matt/menu-simple.py (3251B)
from Tkinter import * # some vocabulary to keep from getting confused. This terminology # is something I cooked up for this file, but follows the man pages # pretty closely # # # # This is a MENUBUTTON # V # +-------------+ # | | # # +------------++------------++------------+ # | || || | # | File || Edit || Options | <-------- the MENUBAR # | || || | # +------------++------------++------------+ # | New... | # | Open... | # | Print | # | | <------ This is a MENU. The lines of text in the menu are # | | MENU ENTRIES # | +---------------+ # | Open Files > | file1 | # | | file2 | # | | another file | <------ this cascading part is also a MENU # +----------------| | # | | # | | # | | # +---------------+ def new_file(): print "opening new file" def open_file(): print "opening OLD file" def makeFileMenu(): # make menu button : "File" File_button = Menubutton(mBar, text='File', underline=0) File_button.pack(side=LEFT, padx="1m") File_button.menu = Menu(File_button) # add an item. The first param is a menu entry type, # must be one of: "cascade", "checkbutton", "command", "radiobutton", "separator" # see menu-demo-2.py for examples of use File_button.menu.add_command(label='New...', underline=0, command=new_file) File_button.menu.add_command(label='Open...', underline=0, command=open_file) File_button.menu.add_command(label='Quit', underline=0, command='exit') # set up a pointer from the file menubutton back to the file menu File_button['menu'] = File_button.menu return File_button def makeEditMenu(): Edit_button = Menubutton(mBar, text='Edit', underline=0) Edit_button.pack(side=LEFT, padx="1m") Edit_button.menu = Menu(Edit_button) # just to be cute, let's disable the undo option: Edit_button.menu.add('command', label="Undo") # Since the tear-off bar is the 0th entry, # undo is the 1st entry... Edit_button.menu.entryconfig(1, state=DISABLED) # and these are just for show. No "command" callbacks attached. Edit_button.menu.add_command(label="Cut") Edit_button.menu.add_command(label="Copy") Edit_button.menu.add_command(label="Paste") # set up a pointer from the file menubutton back to the file menu Edit_button['menu'] = Edit_button.menu return Edit_button ################################################# #### Main starts here ... root = Tk() # make a menu bar mBar = Frame(root, relief=RAISED, borderwidth=2) mBar.pack(fill=X) File_button = makeFileMenu() Edit_button = makeEditMenu() # finally, install the buttons in the menu bar. # This allows for scanning from one menubutton to the next. mBar.tk_menuBar(File_button, Edit_button) root.title('menu demo') root.iconname('packer') root.mainloop()