]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/tglbtn.mm
add wx-prefixed and semicolon-requiring versions of DECLARE_NO_{COPY,ASSIGN}_CLASS...
[wxWidgets.git] / src / osx / cocoa / tglbtn.mm
index d638d955f8443deda2076044a6487ad26f1a2f80..f5d052809e09c2d0f3b216620be1c65fa8174abb 100644 (file)
@@ -34,17 +34,12 @@ wxWidgetImplType* wxWidgetImpl::CreateToggleButton( wxWindowMac* wxpeer,
                                     long style, 
                                     long extraStyle)
 {
-    NSView* sv = (wxpeer->GetParent()->GetHandle() );
-    
-    NSRect r = wxToNSRect( sv, wxRect( pos, size) );
-    // Rect bounds = wxMacGetBoundsForControl( wxpeer, pos , size ) ;
+    NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
     wxNSButton* v = [[wxNSButton alloc] initWithFrame:r];
     
     [v setBezelStyle:NSRoundedBezelStyle];    
     [v setButtonType:NSOnOffButton];
-    [sv addSubview:v];
     wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
-    [v setImplementation:c];
     return c;
 }
 
@@ -57,17 +52,12 @@ wxWidgetImplType* wxWidgetImpl::CreateBitmapToggleButton( wxWindowMac* wxpeer,
                                     long style, 
                                     long extraStyle)
 {    
-    NSView* sv = (wxpeer->GetParent()->GetHandle() );
-    
-    NSRect r = wxToNSRect( sv, wxRect( pos, size) );
-    // Rect bounds = wxMacGetBoundsForControl( wxpeer, pos , size ) ;
+    NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
     wxNSButton* v = [[wxNSButton alloc] initWithFrame:r];
     
     [v setBezelStyle:NSRegularSquareBezelStyle];
     [v setButtonType:NSOnOffButton];
-    [sv addSubview:v];
     wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
-    [v setImplementation:c];
     return c;
 }