]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/radiobut.mm
Added wxPaintDCEx class, to handle the case where an HDC
[wxWidgets.git] / src / cocoa / radiobut.mm
index 020b1952131b199dc1cebff41bcd175bd958b1a1..d486f62aded0866133275e489cbe0c125fbbe01d 100644 (file)
@@ -14,7 +14,8 @@
 #include "wx/log.h"
 
 #import <AppKit/NSButton.h>
-#import <Foundation/NSString.h>
+#include "wx/cocoa/string.h"
+#include "wx/cocoa/autorelease.h"
 
 IMPLEMENT_DYNAMIC_CLASS(wxRadioButton, wxControl)
 // wxRadioButtonBase == wxControl
@@ -30,6 +31,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID winid,
            const wxValidator& validator,
            const wxString& name)
 {
+    wxAutoNSAutoreleasePool pool;
     if(!CreateControl(parent,winid,pos,size,style,validator,name))
         return false;
     m_cocoaNSView = NULL;
@@ -37,7 +39,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID winid,
     SetNSButton([[NSButton alloc] initWithFrame: cocoaRect]);
     [m_cocoaNSView release];
     [GetNSButton() setButtonType: NSRadioButton];
-    [GetNSButton() setTitle:[NSString stringWithCString: label.c_str()]];
+    [GetNSButton() setTitle:wxNSStringWithWxString(label)];
     [GetNSControl() sizeToFit];
 
     if(m_parent)
@@ -47,8 +49,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID winid,
 
 wxRadioButton::~wxRadioButton()
 {
-    CocoaRemoveFromParent();
-    SetNSButton(NULL);
+    DisassociateNSButton(m_cocoaNSView);
 }
 
 void wxRadioButton::SetValue(bool)