[util/popup] add generic "close" on root menu
add a "close" entry for the root menu of all popup menus (if they are not automatically destroyed when leaving the menu). fixes #633
This commit is contained in:
parent
cb13fbf917
commit
55121c86d4
1 changed files with 3 additions and 0 deletions
|
@ -22,6 +22,9 @@ class menu(object):
|
|||
self._root.withdraw()
|
||||
self._menu = tk.Menu(self._root, tearoff=0)
|
||||
self._menu.bind("<FocusOut>", self.__on_focus_out)
|
||||
|
||||
self.add_menuitem("close", self.__on_focus_out)
|
||||
self.add_separator()
|
||||
else:
|
||||
self._root = parent.root()
|
||||
self._root.withdraw()
|
||||
|
|
Loading…
Reference in a new issue