[core/popup_v2] Destroy menu on leave
When mouse leaves the menu, destroy it.
This commit is contained in:
parent
682d2f47dd
commit
6deb80edda
1 changed files with 1 additions and 0 deletions
|
@ -20,6 +20,7 @@ class PopupMenu(object):
|
||||||
self._root.withdraw()
|
self._root.withdraw()
|
||||||
self._menu = tk.Menu(self._root)
|
self._menu = tk.Menu(self._root)
|
||||||
self._menu.bind("<FocusOut>", self._on_focus_out)
|
self._menu.bind("<FocusOut>", self._on_focus_out)
|
||||||
|
self._menu.bind("<Leave>", self._on_focus_out)
|
||||||
|
|
||||||
def _on_focus_out(self, event=None):
|
def _on_focus_out(self, event=None):
|
||||||
self._root.destroy()
|
self._root.destroy()
|
||||||
|
|
Loading…
Reference in a new issue