wx.EVT_KILL_FOCUS is not fired on OSX, so we have to use a different
event to save. I thought EVT_STC_CHANGE of wx.stc would be a good
choice.
See http://www.yellowbrain.com/stc/events.html#EVT_STC_CHANGE

Altered gcodeTextArea slightly to use the new gcodeTextArea on OSX as
well.
This commit is contained in:
Ferdi van der Werf 2012-05-11 02:31:18 +02:00
parent 3c0f3b87e0
commit fbc9af3233
2 changed files with 3 additions and 2 deletions

View file

@ -1,4 +1,4 @@
import wx
import wx,wx.stc
import sys,math,threading,os
from gui import gcodeTextArea
@ -20,6 +20,7 @@ class alterationPanel(wx.Panel):
self.list.SetSelection(0)
self.Bind(wx.EVT_LISTBOX, self.OnSelect, self.list)
self.textArea.Bind(wx.EVT_KILL_FOCUS, self.OnFocusLost, self.textArea)
self.textArea.Bind(wx.stc.EVT_STC_CHANGE, self.OnFocusLost, self.textArea)
sizer = wx.GridBagSizer()
sizer.Add(self.list, (0,0), span=(1,1), flag=wx.EXPAND)

View file

@ -3,7 +3,7 @@ import sys,math,os
from util import profile
if sys.platform == 'darwin':
if False and sys.platform == 'darwin':
class GcodeTextArea(wx.TextCtrl):
def __init__(self, parent):
super(GcodeTextArea, self).__init__(parent, style=wx.TE_MULTILINE|wx.TE_DONTWRAP|wx.TE_PROCESS_TAB)