1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/carbon/bmpbuttn.cpp
3 // Purpose: wxBitmapButton
4 // Author: Stefan Csomor
7 // RCS-ID: $Id: bmpbuttn.cpp 54820 2008-07-29 20:04:11Z SC $
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
16 #include "wx/bmpbuttn.h"
20 #include "wx/dcmemory.h"
23 #include "wx/osx/private.h"
25 wxWidgetImplType* wxWidgetImpl::CreateBitmapButton( wxWindowMac* wxpeer,
28 const wxBitmap& bitmap,
34 NSView* sv = static_cast<NSView*>(wxpeer->GetParent()->GetHandle() );
36 NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
37 wxNSButton* v = [[wxNSButton alloc] initWithFrame:r];
39 [v setBezelStyle:NSRegularSquareBezelStyle];
40 [v setImage:bitmap.GetNSImage() ];
41 [v setButtonType:NSMomentaryPushInButton];
43 wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
44 [v setImplementation:c];