Skip to content
Advertisement

Can’t not update the textbox when clicked the optionmenu

I’m trying to display my selection in the optionmenu to the textbox. Could anyone help me with this one? when I clicked one option in the optionmenu, the textbox didn’t update. Here is my code.

JavaScript

Advertisement

Answer

If you run the code in a terminal, then you should see there is exception when an item is selected in the option menu:

JavaScript

It is because the callback of command option of OptionMenu expects an argument, the selected item, but your function does not have argument.

Just modify the function as below:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement