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

        issue9653
        review304351002
        (grafted from fdcb600a42bced9fb638843edffa786494729ad4)
diffstat:

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

diffs (17 lines):

diff -r 0678b2e4a2ca -r 3310e839c7e2 
tryton/gui/window/view_form/view/list_form.py
--- a/tryton/gui/window/view_form/view/list_form.py     Wed Oct 28 23:56:28 
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