]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/textctrl.mm
fixing class
[wxWidgets.git] / 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
     {