X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3a9fa0d6b59c5c299766b3ed71ccadeeebf3dbb8..42497f30ebde52ebd530a3c252eec45791669287:/src/cocoa/textctrl.mm diff --git a/src/cocoa/textctrl.mm b/src/cocoa/textctrl.mm index 1d858a32b0..6ead7fdd43 100644 --- a/src/cocoa/textctrl.mm +++ b/src/cocoa/textctrl.mm @@ -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]); }