X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4850cc8b2e1037cd394806db4ddcf73868588a4c..d2c5fe6e6e1ab3b4532b4ca0e2eeba4f9c190562:/src/osx/cocoa/bmpbuttn.mm?ds=sidebyside diff --git a/src/osx/cocoa/bmpbuttn.mm b/src/osx/cocoa/bmpbuttn.mm index ab3433bd7f..1cbc2dfa81 100644 --- a/src/osx/cocoa/bmpbuttn.mm +++ b/src/osx/cocoa/bmpbuttn.mm @@ -22,14 +22,14 @@ #include "wx/osx/private.h" -wxWidgetImplType* wxWidgetImpl::CreateBitmapButton( wxWindowMac* wxpeer, - wxWindowMac* parent, - wxWindowID id, +wxWidgetImplType* wxWidgetImpl::CreateBitmapButton( wxWindowMac* wxpeer, + wxWindowMac* WXUNUSED(parent), + wxWindowID WXUNUSED(id), const wxBitmap& bitmap, - const wxPoint& pos, + const wxPoint& pos, const wxSize& size, - long style, - long extraStyle) + long style, + long WXUNUSED(extraStyle)) { NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ; wxNSButton* v = [[wxNSButton alloc] initWithFrame:r]; @@ -46,11 +46,12 @@ wxWidgetImplType* wxWidgetImpl::CreateBitmapButton( wxWindowMac* wxpeer, else [v setBezelStyle:NSRegularSquareBezelStyle]; } - - [v setImage:bitmap.GetNSImage() ]; + + if (bitmap.Ok()) + [v setImage:bitmap.GetNSImage() ]; + [v setButtonType:NSMomentaryPushInButton]; wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v ); - [v setImplementation:c]; return c; }