[Tutor] Tkinter event for changing OptionMenu items

Bernard Lebel 3dbernard at gmail.com
Thu Jul 21 18:19:00 CEST 2005


Hello,

I'm trying to bind an event to the changes made to an OptionMenu. Ie
the user chooses a different item, the rest of the Tk window gets
updated. To repopulate the window, a function would be called by the
binding.

Any suggestion?


var1 = StringVar()
var1.set( aTables[0] )
oOptionMenu = OptionMenu( oRoot, var1, aTables[0], *aTables[1:] )
sTableName = var1.get()
oOptionMenu.bind( '<Return>', getTableColumns )
oOptionMenu.pack( fill = X )

Here the '<Return>' event is obviously not the one I'm looking for,
but is there to illustrate what code I have so far.



Thanks
Bernard


More information about the Tutor mailing list