]> git.saurik.com Git - wxWidgets.git/commitdiff
turning off undo for setter, otherwise memory gets used up for the undo stack, fixes...
authorStefan Csomor <csomor@advancedconcepts.ch>
Sat, 21 Jul 2012 05:14:44 +0000 (05:14 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sat, 21 Jul 2012 05:14:44 +0000 (05:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72166 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/cocoa/textctrl.mm

index 2daf86fb9462c522c4fc25efea419a93f2390294..b1364c509c5ae9ef478dff011c9788f04c4423c2 100644 (file)
@@ -867,7 +867,12 @@ void wxNSTextFieldControl::WriteText(const wxString& str)
     if ( editor )
     {
         wxMacEditHelper helper(m_textField);
+        BOOL hasUndo = [editor respondsToSelector:@selector(setAllowsUndo:)];
+        if ( hasUndo )
+            [editor setAllowsUndo:NO];
         [editor insertText:wxCFStringRef( str , m_wxPeer->GetFont().GetEncoding() ).AsNSString()];
+        if ( hasUndo )
+            [editor setAllowsUndo:YES];
     }
     else
     {