strange option menu behavior
Martin Franklin
mfranklin1 at gatwick.westerngeco.slb.com
Tue Oct 8 07:27:06 EDT 2002
On Tuesday 08 Oct 2002 10:15 am, Heiner Litz wrote:
> HI there!
>
> I implemented a option menu like this:
>
Get hold of a source distro of python and in the Demo/tkinter/guido
subdirectory there is this:-
[bpse at m-franklin guido]$ more optionmenu.py
# option menu sample (Fredrik Lundh, September 1997)
from Tkinter import *
root = Tk()
#
# standard usage
var1 = StringVar()
var1.set("One") # default selection
menu1 = OptionMenu(root, var1, "One", "Two", "Three")
menu1.pack()
#
# initialize from a sequence
CHOICES = "Aah", "Bee", "Cee", "Dee", "Eff"
var2 = StringVar()
var2.set(CHOICES[0])
menu2 = apply(OptionMenu, (root, var2) + tuple(CHOICES))
menu2.pack()
root.mainloop()
HTH
Martin
--
### Python Powered Signature
I started writting this email on
Tue Oct 8 11:25:54 2002
More information about the Python-list
mailing list