changeset 7033ca1d455c in tryton:6.2
details: https://hg.tryton.org/tryton?cmd=changeset&node=7033ca1d455c
description:
        Do not set cursor on not realized TreeView

        issue11596
        review443421003
        (grafted from a999fa1af2f4a523ba9d5610a5fe5fd75bd97526)
diffstat:

 tryton/gui/window/view_form/view/list.py |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 75d9c0cb9b95 -r 7033ca1d455c tryton/gui/window/view_form/view/list.py
--- a/tryton/gui/window/view_form/view/list.py  Sun Jul 24 23:35:45 2022 +0200
+++ b/tryton/gui/window/view_form/view/list.py  Sun Jul 24 23:36:40 2022 +0200
@@ -1143,7 +1143,7 @@
     def set_cursor(self, new=False, reset_view=True):
         self.treeview.grab_focus()
         model = self.treeview.get_model()
-        if self.record and model:
+        if self.record and model and self.treeview.get_realized():
             path = self.record.get_index_path(model.group)
             if model.get_flags() & Gtk.TreeModelFlags.LIST_ONLY:
                 path = (path[0],)

Reply via email to