Feb-12-2019, 12:46 PM
you didn't show enough code for me to answer properly.
What i show will work if tkinter is imported like:
I guess it would be:
What i show will work if tkinter is imported like:
import tlinter as tkif you used:
import tkinterthen it would be:
s = tkinter.StringVar()looking at what you do provide (This is why it's important to include enough code to run an example)
I guess it would be:
def OptionMenu_SelectionEvent(event): print("do whatever here') optionList = ('Server1', 'Server2', 'Server3', 'd') s = StringVar() s.set('a') self.om = OptionMenu(master, s, *optionList, command = OptionMenu_SelectionEvent)