changeset fdcb600a42bc in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset;node=fdcb600a42bc
description:
        Skip set_cursor when the listbox is not realized

        issue9653
        review304351002
diffstat:

 tryton/gui/window/view_form/view/list_form.py |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (17 lines):

diff -r e86e5a48a611 -r fdcb600a42bc 
tryton/gui/window/view_form/view/list_form.py
--- a/tryton/gui/window/view_form/view/list_form.py     Thu Oct 29 00:04:07 
2020 +0100
+++ b/tryton/gui/window/view_form/view/list_form.py     Thu Oct 29 15:07:45 
2020 +0100
@@ -136,9 +136,12 @@
 
     @common.idle_add
     def _select_show_row(self, index):
+        # translate_coordinates requires that both widgets are realized
+        if not self.listbox.get_realized():
+            return
         self.listbox.unselect_all()
         row = self.listbox.get_row_at_index(index)
-        if not row:
+        if not row or not row.get_realized():
             return
         self.listbox.select_row(row)
         y_position = row.translate_coordinates(self.listbox, 0, 0)[1]

Reply via email to