[Tkinter-discuss] OptionMenu, change the list of choices

mkieverpy at tlink.de mkieverpy at tlink.de
Tue Oct 24 15:51:37 CEST 2006

Vasilis Vlachoudis wrote:
> values=["One","Two","Three"]   # Initial list
> o = OptionMenu(frame, *values)
> #...
> #then later in the code read new values from a file
> newvalues = f.readline().split()
> o.config(???=newvalues)
  m = o.children ['menu']
you can access the menu which implements the OptionMenu.
OptionMenu uses 'command' entries.
So you can add new entries with
I never used this personally.
Hope it works for you.

Matthias Kievernagel
mkiever at web dot de

More information about the Tkinter-discuss mailing list