Преглед изворни кода

wxGUI/forms: fix updating dependent widgets with wxPython 3

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@63173 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová пре 10 година
родитељ
комит
f471912385
1 измењених фајлова са 7 додато и 3 уклоњено
  1. 7 3
      gui/wxpython/gui_core/forms.py

+ 7 - 3
gui/wxpython/gui_core/forms.py

@@ -1216,11 +1216,15 @@ class CmdPanel(wx.Panel):
                         # A gselect.Select is a combobox with two children: a textctl and a popupwindow;
                         # we target the textctl here
                         textWin = selection.GetTextCtrl()
-                        p['wxId'] = [ textWin.GetId(), ]
-                        textWin.Bind(wx.EVT_TEXT, self.OnSetValue)
-                    
+                        if globalvar.CheckWxVersion([3]):
+                            p['wxId'] = [selection.GetId(), ]
+                        else:
+                            p['wxId'] = [textWin.GetId(), ]
+
                     if prompt == 'vector':
+                        # handlers should be bound in this order
                         selection.Bind(wx.EVT_TEXT, self.OnUpdateSelection)
+                        selection.Bind(wx.EVT_TEXT, self.OnSetValue)
                         
                         # if formatSelector and p.get('age', 'old') == 'old':
                         #     # OGR supported (read-only)