I am trying to make a tkinter menu's options change when a function is entered. I can verify that the function is entered, but for some reason the function's contents do not seem to be updating the tkinter menu's options. Here is a snippet of the relevant code:
def func(selection):
global menuOptions;
menuOptions = men[selection];
root.update();
men = {
"x1": ["a"],
"x2": ["b", "c"],
"x3": ["d", "e", "f"],
"x4":["g", "h", "i", "j"]
};
menuOptions = [""];
y = tkinter.StringVar();
y.set("");
tkinter.OptionMenu(root, y, *menuOptions).place(x=5, y=5);
As I mentioned, the function is definitely being entered by the rest of the code, but the menu options are not being updated. Any help is appreciated. I am using the most recent version of python and tkinter.
Thanks