X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4dd9fdf82749bb5f9e2bf9c2ad1bbd59e0eeb00e..d58526d55433162cef8ad2ed7f422689862c3019:/src/osx/cocoa/bmpbuttn.mm diff --git a/src/osx/cocoa/bmpbuttn.mm b/src/osx/cocoa/bmpbuttn.mm index fd5f716ff8..516b5fe857 100644 --- a/src/osx/cocoa/bmpbuttn.mm +++ b/src/osx/cocoa/bmpbuttn.mm @@ -23,13 +23,13 @@ #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, - long extraStyle) + long WXUNUSED(extraStyle)) { NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ; wxNSButton* v = [[wxNSButton alloc] initWithFrame:r]; @@ -47,7 +47,9 @@ wxWidgetImplType* wxWidgetImpl::CreateBitmapButton( wxWindowMac* wxpeer, [v setBezelStyle:NSRegularSquareBezelStyle]; } - [v setImage:bitmap.GetNSImage() ]; + if (bitmap.Ok()) + [v setImage:bitmap.GetNSImage() ]; + [v setButtonType:NSMomentaryPushInButton]; wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v ); return c;