tkivy: recreate context menu everytime an item is selected - electrum - Electrum Bitcoin wallet (HTM) git clone https://git.parazyd.org/electrum (DIR) Log (DIR) Files (DIR) Refs (DIR) Submodules --- (DIR) commit b5b367940412177cd531ae6a22faa1454eb382a0 (DIR) parent 5e5f3202b10a65061b433c6bde55da5ee941c497 (HTM) Author: ThomasV <thomasv@electrum.org> Date: Mon, 14 Dec 2015 15:02:57 +0100 kivy: recreate context menu everytime an item is selected Diffstat: M gui/kivy/uix/screens.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) --- (DIR) diff --git a/gui/kivy/uix/screens.py b/gui/kivy/uix/screens.py t@@ -75,18 +75,16 @@ class CScreen(Factory.Screen): self.hide_menu() def hide_menu(self): - if self.context_menu: + if self.context_menu is not None: self.remove_widget(self.context_menu) self.context_menu = None def show_menu(self, obj): - if self.context_menu is None: - self.context_menu = ContextMenu(obj, self.menu_actions) - self.remove_widget(self.context_menu) + self.hide_menu() + self.context_menu = ContextMenu(obj, self.menu_actions) self.add_widget(self.context_menu) - class HistoryScreen(CScreen): tab = ObjectProperty(None)