My problem is the following
I have an application with some menus, which depending of the tasks executed, its options can be configured, namely, the activation or deactivation of some menu options to prevent de user to call something that would cause an undesired behavior of the application.
The problem is that there is the possibility of the user click on the menu and maintain it opened, while the application configures de menu. In fact the menu is changed, but then the menu can freeze and still open even after the mouse leave the menu. However, I noticed If I click outside the application with the mouse, the menu efectivelly closes, and everything goes back to normal, but the user may not be aware of that and can become stuck. Anyway, it is not a interesting behaviour. I think this is a bug of the menu widget, but i'm not sure.
I cannot disable all the menu because there are options that in fact should be available. A solution would be a command to hide de menu after configure him, avoiding that situation. I tried use the "unpost" method, but nothing happened.
There is such possibility or any workaround that can solve my problem?
I leave some images of the aforementioned menu to ilustrate my problem:
Normal

Disabling some options

The "bug" situation

