[chirp_devel] [PATCH] Fix Context-Menu Handler in Memory Editor
# HG changeset patch # User K. Arvanitis kosta@alumni.uvic.ca # Date 1422127655 28800 # Sat Jan 24 11:27:35 2015 -0800 # Node ID 5d6862d6275971cb7429ff14c8fd2a77c86506ef # Parent b25606106a9c0cd78f3cc5f602475da64cde081d [PATCH] Fix Context-Menu Handler in Memory Editor This patch modified the behaviour of the button event handler for the memory editor to properly select the underlying elements of the treeview when using the right mouse button. Fixes #2249 diff -r b25606106a9c -r 5d6862d62759 chirpui/memedit.py --- a/chirpui/memedit.py Wed Jan 21 23:30:19 2015 -0800 +++ b/chirpui/memedit.py Sat Jan 24 11:27:35 2015 -0800 @@ -899,13 +899,17 @@
def click_cb(self, view, event): self.emit("usermsg", "") - if event.button != 3: - return False - - menu = self.make_context_menu() - menu.popup(None, None, None, event.button, event.time) - - return True + if event.button == 3: + pathinfo = view.get_path_at_pos(int(event.x), int(event.y)) + if pathinfo is not None: + path, col, x, y = pathinfo + view.grab_focus() + sel = view.get_selection() + if (not sel.path_is_selected(path)): + view.set_cursor(path, col) + menu = self.make_context_menu() + menu.popup(None, None, None, event.button, event.time) + return True
def get_column_visible(self, col): column = self.view.get_column(col)
participants (1)
-
Kosta Arvanitis