]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/textctrl.mm
m_font may not have been set yet. Default to letting GetTextExtent
[wxWidgets.git] / src / cocoa / textctrl.mm
index 1d858a32b0648a47e5ffbad0ee7a1c113d9d1d10..6ead7fdd43e175125196f043b083a02fe8b6a5b4 100644 (file)
@@ -41,7 +41,8 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID winid,
     m_cocoaNSView = NULL;
     SetNSTextField([[NSTextField alloc] initWithFrame:MakeDefaultNSRect(size)]);
     [m_cocoaNSView release];
-    [GetNSTextField() setStringValue:[NSString stringWithCString:value.c_str()]];
+    [GetNSTextField() setStringValue:wxNSStringWithWxString(value)];
+
     [GetNSControl() sizeToFit];
     NSRect currentFrame = [m_cocoaNSView frame];
     if(currentFrame.size.width < 70)
@@ -200,6 +201,6 @@ bool wxTextCtrl::CanUndo() const
 wxString wxTextCtrl::GetValue() const
 {
     wxAutoNSAutoreleasePool pool;
-    return wxString([[GetNSTextField() stringValue] lossyCString]);
+    return wxStringWithNSString([GetNSTextField() stringValue]);
 }