diff --git a/include/wx/cocoa/statbox.h b/include/wx/cocoa/statbox.h index e6aab49b45..0fab6da0f1 100644 --- a/include/wx/cocoa/statbox.h +++ b/include/wx/cocoa/statbox.h @@ -41,6 +41,9 @@ public: long style = 0, const wxString& name = wxStaticBoxNameStr); virtual ~wxStaticBox(); + virtual void SetLabel(const wxString& label); + virtual wxString GetLabel() const; + // ------------------------------------------------------------------------ // Cocoa callbacks // ------------------------------------------------------------------------ diff --git a/src/cocoa/statbox.mm b/src/cocoa/statbox.mm index 289294fff6..6bfc8111dd 100644 --- a/src/cocoa/statbox.mm +++ b/src/cocoa/statbox.mm @@ -63,3 +63,15 @@ void wxStaticBox::GetBordersForSizer(int *borderTop, int *borderOther) const if(nextBorder > *borderOther) *borderOther = nextBorder; } + +void wxStaticBox::SetLabel(const wxString& label) +{ + wxAutoNSAutoreleasePool pool; + [GetNSBox() setTitle:wxNSStringWithWxString(label)]; +} + +wxString wxStaticBox::GetLabel() const +{ + wxAutoNSAutoreleasePool pool; + return wxStringWithNSString([GetNSBox() title]); +}