Current Path: > > lib64 > python2.7 > Demo > tkinter > > matt
Operation : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 Software : Apache Server IP : 162.0.232.56 | Your IP: 216.73.216.111 Domains : 1034 Domain(s) Permission : [ 0755 ]
Name | Type | Size | Last Modified | Actions |
---|---|---|---|---|
00-HELLO-WORLD.py | File | 724 bytes | April 19 2020 21:13:39. | |
00-HELLO-WORLD.pyc | File | 1299 bytes | April 10 2024 04:58:47. | |
00-HELLO-WORLD.pyo | File | 1299 bytes | April 10 2024 04:58:47. | |
README | File | 513 bytes | April 19 2020 21:13:39. | |
animation-simple.py | File | 939 bytes | April 19 2020 21:13:39. | |
animation-simple.pyc | File | 1720 bytes | April 10 2024 04:58:47. | |
animation-simple.pyo | File | 1720 bytes | April 10 2024 04:58:47. | |
animation-w-velocity-ctrl.py | File | 1201 bytes | April 19 2020 21:13:39. | |
animation-w-velocity-ctrl.pyc | File | 2027 bytes | April 10 2024 04:58:47. | |
animation-w-velocity-ctrl.pyo | File | 2027 bytes | April 10 2024 04:58:47. | |
bind-w-mult-calls-p-type.py | File | 1550 bytes | April 19 2020 21:13:39. | |
bind-w-mult-calls-p-type.pyc | File | 1401 bytes | April 10 2024 04:58:47. | |
bind-w-mult-calls-p-type.pyo | File | 1401 bytes | April 10 2024 04:58:47. | |
canvas-demo-simple.py | File | 748 bytes | April 19 2020 21:13:39. | |
canvas-demo-simple.pyc | File | 1421 bytes | April 10 2024 04:58:47. | |
canvas-demo-simple.pyo | File | 1421 bytes | April 10 2024 04:58:47. | |
canvas-gridding.py | File | 2271 bytes | April 19 2020 21:13:39. | |
canvas-gridding.pyc | File | 2323 bytes | April 10 2024 04:58:47. | |
canvas-gridding.pyo | File | 2323 bytes | April 10 2024 04:58:47. | |
canvas-moving-or-creating.py | File | 2422 bytes | April 19 2020 21:13:39. | |
canvas-moving-or-creating.pyc | File | 2583 bytes | April 10 2024 04:58:47. | |
canvas-moving-or-creating.pyo | File | 2583 bytes | April 10 2024 04:58:47. | |
canvas-moving-w-mouse.py | File | 2126 bytes | April 19 2020 21:13:39. | |
canvas-moving-w-mouse.pyc | File | 2473 bytes | April 10 2024 04:58:47. | |
canvas-moving-w-mouse.pyo | File | 2473 bytes | April 10 2024 04:58:47. | |
canvas-mult-item-sel.py | File | 2841 bytes | April 19 2020 21:13:39. | |
canvas-mult-item-sel.pyc | File | 2806 bytes | April 10 2024 04:58:47. | |
canvas-mult-item-sel.pyo | File | 2806 bytes | April 10 2024 04:58:47. | |
canvas-reading-tag-info.py | File | 1678 bytes | April 19 2020 21:13:39. | |
canvas-reading-tag-info.pyc | File | 1860 bytes | April 10 2024 04:58:47. | |
canvas-reading-tag-info.pyo | File | 1860 bytes | April 10 2024 04:58:47. | |
canvas-w-widget-draw-el.py | File | 1178 bytes | April 19 2020 21:13:39. | |
canvas-w-widget-draw-el.pyc | File | 1505 bytes | April 10 2024 04:58:47. | |
canvas-w-widget-draw-el.pyo | File | 1505 bytes | April 10 2024 04:58:47. | |
canvas-with-scrollbars.py | File | 2110 bytes | April 19 2020 21:13:39. | |
canvas-with-scrollbars.pyc | File | 2363 bytes | April 10 2024 04:58:47. | |
canvas-with-scrollbars.pyo | File | 2363 bytes | April 10 2024 04:58:47. | |
dialog-box.py | File | 2440 bytes | April 19 2020 21:13:39. | |
dialog-box.pyc | File | 1978 bytes | April 10 2024 04:58:47. | |
dialog-box.pyo | File | 1978 bytes | April 10 2024 04:58:47. | |
entry-simple.py | File | 729 bytes | April 19 2020 21:13:39. | |
entry-simple.pyc | File | 1076 bytes | April 10 2024 04:58:47. | |
entry-simple.pyo | File | 1076 bytes | April 10 2024 04:58:47. | |
entry-with-shared-variable.py | File | 1747 bytes | April 19 2020 21:13:39. | |
entry-with-shared-variable.pyc | File | 1640 bytes | April 10 2024 04:58:47. | |
entry-with-shared-variable.pyo | File | 1640 bytes | April 10 2024 04:58:47. | |
killing-window-w-wm.py | File | 1295 bytes | April 19 2020 21:13:39. | |
killing-window-w-wm.pyc | File | 1493 bytes | April 10 2024 04:58:47. | |
killing-window-w-wm.pyo | File | 1493 bytes | April 10 2024 04:58:47. | |
menu-all-types-of-entries.py | File | 9110 bytes | April 19 2020 21:13:39. | |
menu-all-types-of-entries.pyc | File | 4971 bytes | April 10 2024 04:58:47. | |
menu-all-types-of-entries.pyo | File | 4971 bytes | April 10 2024 04:58:47. | |
menu-simple.py | File | 3251 bytes | April 19 2020 21:13:39. | |
menu-simple.pyc | File | 1961 bytes | April 10 2024 04:58:47. | |
menu-simple.pyo | File | 1961 bytes | April 10 2024 04:58:47. | |
not-what-you-might-think-1.py | File | 675 bytes | April 19 2020 21:13:39. | |
not-what-you-might-think-1.pyc | File | 1300 bytes | April 10 2024 04:58:47. | |
not-what-you-might-think-1.pyo | File | 1300 bytes | April 10 2024 04:58:47. | |
not-what-you-might-think-2.py | File | 747 bytes | April 19 2020 21:13:39. | |
not-what-you-might-think-2.pyc | File | 1335 bytes | April 10 2024 04:58:47. | |
not-what-you-might-think-2.pyo | File | 1335 bytes | April 10 2024 04:58:47. | |
packer-and-placer-together.py | File | 1209 bytes | April 19 2020 21:13:39. | |
packer-and-placer-together.pyc | File | 1388 bytes | April 10 2024 04:58:47. | |
packer-and-placer-together.pyo | File | 1388 bytes | April 10 2024 04:58:47. | |
packer-simple.py | File | 819 bytes | April 19 2020 21:13:39. | |
packer-simple.pyc | File | 1424 bytes | April 10 2024 04:58:47. | |
packer-simple.pyo | File | 1424 bytes | April 10 2024 04:58:47. | |
placer-simple.py | File | 1078 bytes | April 19 2020 21:13:39. | |
placer-simple.pyc | File | 1293 bytes | April 10 2024 04:58:47. | |
placer-simple.pyo | File | 1293 bytes | April 10 2024 04:58:47. | |
pong-demo-1.py | File | 1549 bytes | April 19 2020 21:13:39. | |
pong-demo-1.pyc | File | 2128 bytes | April 10 2024 04:58:47. | |
pong-demo-1.pyo | File | 2128 bytes | April 10 2024 04:58:47. | |
printing-coords-of-items.py | File | 2400 bytes | April 19 2020 21:13:39. | |
printing-coords-of-items.pyc | File | 2582 bytes | April 10 2024 04:58:47. | |
printing-coords-of-items.pyo | File | 2582 bytes | April 10 2024 04:58:47. | |
radiobutton-simple.py | File | 2011 bytes | April 19 2020 21:13:39. | |
radiobutton-simple.pyc | File | 1864 bytes | April 10 2024 04:58:47. | |
radiobutton-simple.pyo | File | 1864 bytes | April 10 2024 04:58:47. | |
rubber-band-box-demo-1.py | File | 2134 bytes | April 19 2020 21:13:39. | |
rubber-band-box-demo-1.pyc | File | 2569 bytes | April 10 2024 04:58:47. | |
rubber-band-box-demo-1.pyo | File | 2569 bytes | April 10 2024 04:58:47. | |
rubber-line-demo-1.py | File | 1919 bytes | April 19 2020 21:13:39. | |
rubber-line-demo-1.pyc | File | 2273 bytes | April 10 2024 04:58:47. | |
rubber-line-demo-1.pyo | File | 2273 bytes | April 10 2024 04:58:47. | |
slider-demo-1.py | File | 1000 bytes | April 19 2020 21:13:39. | |
slider-demo-1.pyc | File | 1712 bytes | April 10 2024 04:58:47. | |
slider-demo-1.pyo | File | 1712 bytes | April 10 2024 04:58:47. | |
subclass-existing-widgets.py | File | 677 bytes | April 19 2020 21:13:39. | |
subclass-existing-widgets.pyc | File | 1234 bytes | April 10 2024 04:58:47. | |
subclass-existing-widgets.pyo | File | 1234 bytes | April 10 2024 04:58:47. | |
two-radio-groups.py | File | 3758 bytes | April 19 2020 21:13:39. | |
two-radio-groups.pyc | File | 2192 bytes | April 10 2024 04:58:47. | |
two-radio-groups.pyo | File | 2192 bytes | April 10 2024 04:58:47. | |
window-creation-more.py | File | 1020 bytes | April 19 2020 21:13:39. | |
window-creation-more.pyc | File | 1719 bytes | April 10 2024 04:58:47. | |
window-creation-more.pyo | File | 1719 bytes | April 10 2024 04:58:47. | |
window-creation-simple.py | File | 815 bytes | April 19 2020 21:13:39. | |
window-creation-simple.pyc | File | 1642 bytes | April 10 2024 04:58:47. | |
window-creation-simple.pyo | File | 1642 bytes | April 10 2024 04:58:47. | |
window-creation-w-location.py | File | 1325 bytes | April 19 2020 21:13:39. | |
window-creation-w-location.pyc | File | 2100 bytes | April 10 2024 04:58:47. | |
window-creation-w-location.pyo | File | 2100 bytes | April 10 2024 04:58:47. |
from Tkinter import * # The way to think about this is that each radio button menu # controls a different variable -- clicking on one of the # mutually exclusive choices in a radiobutton assigns some value # to an application variable you provide. When you define a # radiobutton menu choice, you have the option of specifying the # name of a varaible and value to assign to that variable when # that choice is selected. This clever mechanism relieves you, # the programmer, from having to write a dumb callback that # probably wouldn't have done anything more than an assignment # anyway. The Tkinter options for this follow their Tk # counterparts: # {"variable" : my_flavor_variable, "value" : "strawberry"} # where my_flavor_variable is an instance of one of the # subclasses of Variable, provided in Tkinter.py (there is # StringVar(), IntVar(), DoubleVar() and BooleanVar() to choose # from) def makePoliticalParties(var): # make menu button Radiobutton_button = Menubutton(mBar, text='Political Party', underline=0) Radiobutton_button.pack(side=LEFT, padx='2m') # the primary pulldown Radiobutton_button.menu = Menu(Radiobutton_button) Radiobutton_button.menu.add_radiobutton(label='Republican', variable=var, value=1) Radiobutton_button.menu.add('radiobutton', {'label': 'Democrat', 'variable' : var, 'value' : 2}) Radiobutton_button.menu.add('radiobutton', {'label': 'Libertarian', 'variable' : var, 'value' : 3}) var.set(2) # set up a pointer from the file menubutton back to the file menu Radiobutton_button['menu'] = Radiobutton_button.menu return Radiobutton_button def makeFlavors(var): # make menu button Radiobutton_button = Menubutton(mBar, text='Flavors', underline=0) Radiobutton_button.pack(side=LEFT, padx='2m') # the primary pulldown Radiobutton_button.menu = Menu(Radiobutton_button) Radiobutton_button.menu.add_radiobutton(label='Strawberry', variable=var, value='Strawberry') Radiobutton_button.menu.add_radiobutton(label='Chocolate', variable=var, value='Chocolate') Radiobutton_button.menu.add_radiobutton(label='Rocky Road', variable=var, value='Rocky Road') # choose a default var.set("Chocolate") # set up a pointer from the file menubutton back to the file menu Radiobutton_button['menu'] = Radiobutton_button.menu return Radiobutton_button def printStuff(): print "party is", party.get() print "flavor is", flavor.get() print ################################################# #### Main starts here ... root = Tk() # make a menu bar mBar = Frame(root, relief=RAISED, borderwidth=2) mBar.pack(fill=X) # make two application variables, # one to control each radio button set party = IntVar() flavor = StringVar() Radiobutton_button = makePoliticalParties(party) Radiobutton_button2 = makeFlavors(flavor) # finally, install the buttons in the menu bar. # This allows for scanning from one menubutton to the next. mBar.tk_menuBar(Radiobutton_button, Radiobutton_button2) b = Button(root, text="print party and flavor", foreground="red", command=printStuff) b.pack(side=TOP) root.title('menu demo') root.iconname('menu demo') root.mainloop()
SILENT KILLER Tool