From 1ab2ea594086b89f771bf4354ab2c3202055d143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 2 Jun 2008 21:54:33 +0200 Subject: [PATCH] Improve selection in tree view - add unselect previous selection - set cursor to the first row --- tryton/gui/window/tree.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tryton/gui/window/tree.py b/tryton/gui/window/tree.py index dc94db5135..9b228435c1 100644 --- a/tryton/gui/window/tree.py +++ b/tryton/gui/window/tree.py @@ -185,7 +185,9 @@ class Tree(SignalEvent): if self.tree_res.view.get_model().get_iter_root(): self.tree_res.view.grab_focus() selection = self.tree_res.view.get_selection() + selection.unselect_all() selection.select_path((0)) + self.tree_res.view.set_cursor((0)) return False def menu_main_key_press(self, widget, event): @@ -193,7 +195,9 @@ class Tree(SignalEvent): if self.tree_res.view.get_model().get_iter_root(): self.tree_res.view.grab_focus() selection = self.tree_res.view.get_selection() + selection.unselect_all() selection.select_path((0)) + self.tree_res.view.set_cursor((0)) def sig_print(self): self.sig_action('form_print')