'Updating optionMenu when pressed

I searched all over the internet, and couldn't find a way to update the options menu when it is pressed. I should have a method that will run after the optionsMenu is pressed, like an actual button, such that the options are immediately updated according to the above method.
Is this even possible? if there isn't such a way, is there a good alternative for this over Tkinter, which looks as good as optionsMenu?

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source