X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/32cd189dfcfe96c41e32c3b9827bf67484c60b13..63e1921d0be4956ab729735189ccf637773a7e27:/src/cocoa/checkbox.mm diff --git a/src/cocoa/checkbox.mm b/src/cocoa/checkbox.mm index 0e73912c1f..373a1c4b33 100644 --- a/src/cocoa/checkbox.mm +++ b/src/cocoa/checkbox.mm @@ -6,7 +6,7 @@ // Created: 2003/03/16 // RCS-ID: $Id$ // Copyright: (c) 2003 David Elliott -// Licence: wxWidgets licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" @@ -26,7 +26,6 @@ #import #import -IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl) BEGIN_EVENT_TABLE(wxCheckBox, wxCheckBoxBase) END_EVENT_TABLE() WX_IMPLEMENT_COCOA_OWNER(wxCheckBox,NSButton,NSControl,NSView) @@ -47,7 +46,7 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID winid, [m_cocoaNSView release]; [GetNSButton() setButtonType: NSSwitchButton]; [GetNSButton() setAllowsMixedState: Is3State()]; - [GetNSButton() setTitle:wxNSStringWithWxString(GetLabelText(label))]; + CocoaSetLabelForObject(label, GetNSButton()); [GetNSControl() sizeToFit]; if(m_parent) @@ -140,6 +139,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