[Tutor] Tkinter OptionMenu question

Alan Gauld alan.gauld@blueyonder.co.uk
Thu Jun 5 18:58:02 2003


> I was wondering if anyone here knows how to change the items in a 
> Tkinter OptionMenu after it's initial creation.  I am using the 
> following code to create the menu initially:

First its not a Tkinter component its a PMW component!(I got very
confused till I figured that out...). 

Second the method you want is 

setItems(items,index=None)

So you can pass in a new list of items(or a modified 
version of the original). THe docs are ambiguous about the role 
of index, but it may be that if you specify an index value you 
can replace a specific item, but I'm not certain...

Source: John Grayson's book "Python and Tkinter Programming"

HTH,

Alan G.