]> git.saurik.com Git - wxWidgets.git/commitdiff
Implement GetLabel and SetLabel
authorDavid Elliott <dfe@tgwbd.org>
Wed, 16 Jul 2003 14:54:59 +0000 (14:54 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Wed, 16 Jul 2003 14:54:59 +0000 (14:54 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22017 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/cocoa/button.h
src/cocoa/button.mm

index 748bd0cb1efa8a009cca0d2ec80b89482f6a3fde..0cf3f2df6db75aec2f83210bf1b787a2106970b0 100644 (file)
@@ -54,6 +54,8 @@ protected:
 // Implementation
 // ------------------------------------------------------------------------
 public:
+    wxString GetLabel() const;
+    void SetLabel(const wxString& label);
 };
 
 #endif // __WX_COCOA_BUTTON_H__
index b8850cf8eec47af93a3cd09bb6ec3b9f2795125e..08d2b9853c2fb61a9fd094c127731b3d6ef0b5a8 100644 (file)
@@ -66,6 +66,16 @@ void wxButton::Cocoa_wxNSButtonAction(void)
     Command(event);
 }
 
+wxString wxButton::GetLabel() const
+{
+    return wxString([[GetNSButton() title] lossyCString]);
+}
+
+void wxButton::SetLabel(const wxString& label)
+{
+    [GetNSButton() setTitle:wxNSStringWithWxString(label)];
+}
+
 wxSize wxButtonBase::GetDefaultSize()
 {
     // FIXME: stub