]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/button.mm
minor changes to eliminate unused parameter warning + some cleanup
[wxWidgets.git] / src / cocoa / button.mm
index 46a2201e0e51a1e143bdf7236747ccad41d68131..08d2b9853c2fb61a9fd094c127731b3d6ef0b5a8 100644 (file)
@@ -16,6 +16,8 @@
     #include "wx/log.h"
 #endif
 
+#include "wx/cocoa/autorelease.h"
+
 #import <AppKit/NSButton.h>
 #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;
+}
+