X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/570aaadf1ff3f8c3f8ecfea44dbeae64532c82c4..350fffae72c078442d6d177d2071e62f2687df9f:/src/cocoa/button.mm diff --git a/src/cocoa/button.mm b/src/cocoa/button.mm index 46a2201e0e..08d2b9853c 100644 --- a/src/cocoa/button.mm +++ b/src/cocoa/button.mm @@ -16,6 +16,8 @@ #include "wx/log.h" #endif +#include "wx/cocoa/autorelease.h" + #import #include "wx/cocoa/string.h" @@ -29,6 +31,7 @@ bool wxButton::Create(wxWindow *parent, wxWindowID winid, const wxSize& size, long style, const wxValidator& validator, const wxString& name) { + wxAutoNSAutoreleasePool pool; wxLogDebug("Creating control with id=%d",winid); if(!CreateControl(parent,winid,pos,size,style,validator,name)) return false; @@ -63,3 +66,19 @@ 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 + return wxDefaultSize; +} +