changeset 33a47c966fb6 in tryton:5.4
details: https://hg.tryton.org/tryton?cmd=changeset;node=33a47c966fb6
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 fdf2443b558b -r 33a47c966fb6 
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