From 7d27dcf906d8a60e5673e189624091a973bcc319 Mon Sep 17 00:00:00 2001 From: David Elliott Date: Fri, 11 Jul 2003 13:43:57 +0000 Subject: [PATCH 1/1] Implement SetValue() and GetValue() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21893 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/cocoa/textctrl.mm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cocoa/textctrl.mm b/src/cocoa/textctrl.mm index d417f3a36a..e0747d8983 100644 --- a/src/cocoa/textctrl.mm +++ b/src/cocoa/textctrl.mm @@ -12,6 +12,8 @@ #include "wx/app.h" #include "wx/textctrl.h" +#include "wx/cocoa/string.h" + #import #import @@ -110,8 +112,9 @@ void wxTextCtrl::Replace(long, long, wxString const&) { } -void wxTextCtrl::SetValue(wxString const&) +void wxTextCtrl::SetValue(wxString const& value) { + [GetNSTextField() setStringValue: wxNSStringWithWxString(value)]; } void wxTextCtrl::WriteText(wxString const&) @@ -179,6 +182,6 @@ bool wxTextCtrl::CanUndo() const wxString wxTextCtrl::GetValue() const { - return wxEmptyString; + return wxString([[GetNSTextField() stringValue] lossyCString]); } -- 2.45.2