]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/textctrl.mm
Implement SetValue() and GetValue()
[wxWidgets.git] / src / cocoa / textctrl.mm
index d417f3a36a7e596731e7816019790f3edfa7c283..e0747d89831c832284216266195ae46ee6239bf6 100644 (file)
@@ -12,6 +12,8 @@
 #include "wx/app.h"
 #include "wx/textctrl.h"
 
+#include "wx/cocoa/string.h"
+
 #import <Foundation/NSString.h>
 #import <AppKit/NSTextField.h>
 
@@ -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]);
 }