X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ab1ce969dfb27f5d366ee6a0de3ff2bc0205b56a..47583ac10327986031e89c13b75238fc6f66381c:/src/cocoa/checkbox.mm?ds=inline diff --git a/src/cocoa/checkbox.mm b/src/cocoa/checkbox.mm index dccffa0053..ec2915a257 100644 --- a/src/cocoa/checkbox.mm +++ b/src/cocoa/checkbox.mm @@ -47,7 +47,7 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID winid, [m_cocoaNSView release]; [GetNSButton() setButtonType: NSSwitchButton]; [GetNSButton() setAllowsMixedState: Is3State()]; - [GetNSButton() setTitle:wxNSStringWithWxString(wxStripMenuCodes(label))]; + CocoaSetLabelForObject(label, GetNSButton()); [GetNSControl() sizeToFit]; if(m_parent) @@ -140,6 +140,14 @@ void wxCheckBox::Cocoa_wxNSButtonAction(void) void wxCheckBox::SetLabel(const wxString& s) { wxAutoNSAutoreleasePool pool; - [GetNSButton() setTitle:wxNSStringWithWxString(s)]; + CocoaSetLabelForObject(s, GetNSButton()); } -#endif + +wxString wxCheckBox::GetLabel() const +{ + wxAutoNSAutoreleasePool pool; + return wxStringWithNSString([GetNSButton() title]); + +} + +#endif // wxUSE_CHECKBOX