END_EVENT_TABLE()
WX_IMPLEMENT_COCOA_OWNER(wxBitmapButton,NSButton,NSControl,NSView)
END_EVENT_TABLE()
WX_IMPLEMENT_COCOA_OWNER(wxBitmapButton,NSButton,NSControl,NSView)
bool wxBitmapButton::Create(wxWindow *parent, wxWindowID winid,
const wxBitmap& bitmap, const wxPoint& pos,
const wxSize& size, long style,
const wxValidator& validator, const wxString& name)
{
wxAutoNSAutoreleasePool pool;
bool wxBitmapButton::Create(wxWindow *parent, wxWindowID winid,
const wxBitmap& bitmap, const wxPoint& pos,
const wxSize& size, long style,
const wxValidator& validator, const wxString& name)
{
wxAutoNSAutoreleasePool pool;
if(!CreateControl(parent,winid,pos,size,style,validator,name))
return false;
if(!CreateControl(parent,winid,pos,size,style,validator,name))
return false;
m_cocoaNSView = NULL;
SetNSButton([[NSButton alloc] initWithFrame: MakeDefaultNSRect(size)]);
// NOTE: YES we want to release this (to match the alloc).
// DoAddChild(this) will retain us again since addSubView doesn't.
[m_cocoaNSView release];
m_cocoaNSView = NULL;
SetNSButton([[NSButton alloc] initWithFrame: MakeDefaultNSRect(size)]);
// NOTE: YES we want to release this (to match the alloc).
// DoAddChild(this) will retain us again since addSubView doesn't.
[m_cocoaNSView release];
- [GetNSButton() setBezelStyle:NSRoundedBezelStyle];
- [GetNSButton() setTitle:@"Bitmap Button"];
+ [GetNSButton() setBezelStyle: NSRegularSquareBezelStyle];
+ [GetNSButton() setImage:bitmap.GetNSImage(true)];
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId());
InitCommandEvent(event); // event.SetEventObject(this);
Command(event);
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId());
InitCommandEvent(event); // event.SetEventObject(this);
Command(event);