Quoting Bernard Lebel <[EMAIL PROTECTED]>:

> I have this problem. I build a list of elements, and I never know in
> advance how many or what will be the elements.
> 
> I then wish to populate an OptionMenu with this list of elements.

Do you know the list of elements before you create the option menu?

If so, you can do something like this:

# suppose aElements is the list of elements, and var1 is a StringVar.
oOption = OptionMenu(oRoot, var1, aElements[0], *aElements[1:])

If you want to create the OptionMenu first, and then later set the list of
elements ... then it is a bit more difficult.

-- 
John.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to