From 78e19329f54ef4bfc8062bad2be2df8ab4dda0b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 8 Jun 2008 15:00:24 +0200 Subject: [PATCH] Set cursor to last row when Esc is pressed on the last row --- tryton/gui/window/view_form/view/list_gtk/editabletree.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tryton/gui/window/view_form/view/list_gtk/editabletree.py b/tryton/gui/window/view_form/view/list_gtk/editabletree.py index a1a427c4d7..118224dc8f 100644 --- a/tryton/gui/window/view_form/view/list_gtk/editabletree.py +++ b/tryton/gui/window/view_form/view/list_gtk/editabletree.py @@ -198,6 +198,9 @@ class EditableTreeView(gtk.TreeView): self.screen.current_model = False if not path[0]: self.screen.current_model = False + if path[0] == len(self.screen.models.models) \ + and path[0]: + path = (path[0] - 1,) self.screen.display() self.set_cursor(path, column, False) elif event.keyval in (gtk.keysyms.F3, gtk.keysyms.F2):