Kaynağa Gözat

wxGUI/prompt: fix crashing on Mac with wxPython3

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@60984 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 10 yıl önce
ebeveyn
işleme
4b3615713e
1 değiştirilmiş dosya ile 2 ekleme ve 1 silme
  1. 2 1
      gui/wxpython/gui_core/prompt.py

+ 2 - 1
gui/wxpython/gui_core/prompt.py

@@ -177,7 +177,8 @@ class GPromptSTC(GPrompt, wx.stc.StyledTextCtrl):
         self.Bind(wx.EVT_KEY_DOWN, self.OnKeyPressed)
         self.Bind(wx.EVT_KEY_DOWN, self.OnKeyPressed)
         self.Bind(wx.stc.EVT_STC_AUTOCOMP_SELECTION, self.OnItemSelected)
         self.Bind(wx.stc.EVT_STC_AUTOCOMP_SELECTION, self.OnItemSelected)
         self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemChanged)
         self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemChanged)
-        self.Bind(wx.EVT_KILL_FOCUS, self.OnKillFocus)
+        if sys.platform != 'darwin':  # unstable on Mac with wxPython 3
+            self.Bind(wx.EVT_KILL_FOCUS, self.OnKillFocus)
 
 
         # signal which requests showing of a notification
         # signal which requests showing of a notification
         self.showNotification = Signal('GPromptSTC.showNotification')
         self.showNotification = Signal('GPromptSTC.showNotification')