public :
     wxMacEditHelper( NSView* textView )
     {
-        m_textView = textView ;
+        m_textView = textView;
+        m_formerState = YES;
         if ( textView )
         {
             m_formerState = [textView isEditable];
     m_lastKeyDownEvent = formerEvent;
 }
 
-void wxNSTextViewControl::SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack )
+void wxNSTextViewControl::SetFont( const wxFont & font , const wxColour& WXUNUSED(foreground) , long WXUNUSED(windowStyle), bool WXUNUSED(ignoreBlack) )
 {
     if ([m_textView respondsToSelector:@selector(setFont:)])
         [m_textView setFont: font.OSXGetNSFont()];
 wxWidgetImplType* wxWidgetImpl::CreateTextControl( wxTextCtrl* wxpeer,
                                     wxWindowMac* WXUNUSED(parent),
                                     wxWindowID WXUNUSED(id),
-                                    const wxString& str,
+                                    const wxString& WXUNUSED(str),
                                     const wxPoint& pos,
                                     const wxSize& size,
                                     long style,
         wxNSTextScrollView* v = nil;
         v = [[wxNSTextScrollView alloc] initWithFrame:r];
         c = new wxNSTextViewControl( wxpeer, v );
-        static_cast<wxNSTextViewControl*>(c)->SetStringValue(str);
     }
     else
     {
         [v setBordered:NO];
 
         c = new wxNSTextFieldControl( wxpeer, v );
-        static_cast<wxNSTextFieldControl*>(c)->SetStringValue(str);
     }
 
     return c;
 
     m_peer = wxWidgetImpl::CreateTextControl( this, GetParent(), GetId(), str, pos, size, style, GetExtraStyle() );
 
     MacPostControlCreate(pos, size) ;
-
+    
+#if wxOSX_USE_COCOA
+    // under carbon everything can already be set before the MacPostControlCreate embedding takes place
+    // but under cocoa for single line textfields this only works after everything has been set up
+    GetTextPeer()->SetStringValue(str);
+#endif
+    
     // only now the embedding is correct and we can do a positioning update
 
     MacSuperChangedPosition() ;