diff --git a/include/wx/cocoa/checkbox.h b/include/wx/cocoa/checkbox.h index f457f3386b..4ce89830fc 100644 --- a/include/wx/cocoa/checkbox.h +++ b/include/wx/cocoa/checkbox.h @@ -58,6 +58,8 @@ protected: public: virtual void SetValue(bool); virtual bool GetValue() const; + virtual void SetLabel(const wxString& label); + virtual wxString GetLabel() const { return GetTitle(); } protected: virtual void DoSet3StateValue(wxCheckBoxState state); virtual wxCheckBoxState DoGet3StateValue() const; diff --git a/src/cocoa/checkbox.mm b/src/cocoa/checkbox.mm index c75820d257..13ee14009c 100644 --- a/src/cocoa/checkbox.mm +++ b/src/cocoa/checkbox.mm @@ -136,4 +136,9 @@ void wxCheckBox::Cocoa_wxNSButtonAction(void) Command(event); } +void wxCheckBox::SetLabel(const wxString& s) +{ + wxAutoNSAutoreleasePool pool; + [GetNSButton() setTitle:wxNSStringWithWxString(s)]; +} #endif