]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/bmpbuttn.mm
wxUSE_PROPGRID is now recognized by source and header files
[wxWidgets.git] / src / osx / cocoa / bmpbuttn.mm
index ac47c4f03f2cee48d2a4634681894fd8a9694dad..3de4eafe5facd3f22a76f3a6e58df12c80382898 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        src/mac/carbon/bmpbuttn.cpp
+// Name:        src/osx/carbon/bmpbuttn.cpp
 // Purpose:     wxBitmapButton
 // Author:      Stefan Csomor
 // Modified by:
@@ -31,14 +31,13 @@ wxWidgetImplType* wxWidgetImpl::CreateBitmapButton( wxWindowMac* wxpeer,
                                     long style, 
                                     long extraStyle) 
 {
-    NSView* sv = (wxpeer->GetParent()->GetHandle() );
+    NSView* sv = static_cast<NSView*>(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 setImage:bitmap.GetNSImage() ];
     [v setButtonType:NSMomentaryPushInButton];
     [sv addSubview:v];
     wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );