I am running Python 3.3.3 (and now I'm on Ubuntu, but I'm also developing on Mac and Windows that I haven't tested yet). I have a Treeview object that responds to the right click on the elements and shows the context menu depending on what you click ... but I noticed that if you right-click in another place and the original menu will open , it will simply open another.
In fact, a normal click does not hide them. Even when I close the window, the menu still remains floating. The only way to get them to leave is to click on one of the options.
The end result is as follows:

My menu code is as follows:
def rightclick_listitem(self, event):
rowitem = self.sources.identify('item', event.x, event.y)
if rowitem == '':
print('Right clicked an empty space.')
return
self.sources.selection_set(rowitem)
rcmenu = Menu(self.root, tearoff=0)
plugin_disabled=self.sources.item(rowitem, 'values')[0] == 'Disabled'
if plugin_disabled:
rcmenu.add_command(label='Plugin is disabled...',
command=self.plugin_disabled_click)
rcmenu.add_command(label='Plugin options',state='disabled' if plugin_disabled else 'active')
rcmenu.add_command(label='Uninstall plugin')
rcmenu.post(event.x_root, event.y_root)
The code that calls this code is here:
self.sources.bind(RIGHTMOUSE, self.rightclick_listitem)
googled . tkinter python , . .
, : https://github.com/Mgamerz/Fresh-Set-of-Images (freshsetofimages.py)
.
, : https://github.com/Mgamerz/fsoi_plugins