]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/bmpbuttn.mm
correcting #ifdef to #if, fixes #11062
[wxWidgets.git] / src / osx / cocoa / bmpbuttn.mm
index ab3433bd7fb7134dc7edcc86e088aa5b89cba3ae..516b5fe857ec06bb4770b0cedbb95720efcce875 100644 (file)
 #include "wx/osx/private.h"
 
 wxWidgetImplType* wxWidgetImpl::CreateBitmapButton( wxWindowMac* wxpeer, 
 #include "wx/osx/private.h"
 
 wxWidgetImplType* wxWidgetImpl::CreateBitmapButton( wxWindowMac* wxpeer, 
-                                    wxWindowMac* parent
-                                    wxWindowID id
+                                    wxWindowMac* WXUNUSED(parent)
+                                    wxWindowID WXUNUSED(id)
                                     const wxBitmap& bitmap,
                                     const wxPoint& pos, 
                                     const wxSize& size,
                                     long style, 
                                     const wxBitmap& bitmap,
                                     const wxPoint& pos, 
                                     const wxSize& size,
                                     long style, 
-                                    long extraStyle
+                                    long WXUNUSED(extraStyle)
 {
     NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
     wxNSButton* v = [[wxNSButton alloc] initWithFrame:r];
 {
     NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
     wxNSButton* v = [[wxNSButton alloc] initWithFrame:r];
@@ -47,10 +47,11 @@ wxWidgetImplType* wxWidgetImpl::CreateBitmapButton( wxWindowMac* wxpeer,
             [v setBezelStyle:NSRegularSquareBezelStyle];
     }
     
             [v setBezelStyle:NSRegularSquareBezelStyle];
     }
     
-    [v setImage:bitmap.GetNSImage() ];
+    if (bitmap.Ok())
+        [v setImage:bitmap.GetNSImage() ];
+    
     [v setButtonType:NSMomentaryPushInButton];
     wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
     [v setButtonType:NSMomentaryPushInButton];
     wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
-    [v setImplementation:c];
     return c;
 }
 
     return c;
 }