Create an NSView (in leiu of a real static bitmap class)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19765 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
72ad377f13
commit
a8c80eb142
@ -12,6 +12,8 @@
|
|||||||
#include "wx/app.h"
|
#include "wx/app.h"
|
||||||
#include "wx/statbmp.h"
|
#include "wx/statbmp.h"
|
||||||
|
|
||||||
|
#import <AppKit/NSView.h>
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
|
IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
|
||||||
BEGIN_EVENT_TABLE(wxStaticBitmap, wxControl)
|
BEGIN_EVENT_TABLE(wxStaticBitmap, wxControl)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
@ -27,6 +29,8 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID winid,
|
|||||||
if(!CreateControl(parent,winid,pos,size,style,wxDefaultValidator,name))
|
if(!CreateControl(parent,winid,pos,size,style,wxDefaultValidator,name))
|
||||||
return false;
|
return false;
|
||||||
m_cocoaNSView = NULL;
|
m_cocoaNSView = NULL;
|
||||||
|
SetNSView([[NSView alloc] initWithFrame: NSMakeRect(10,10,20,20)]);
|
||||||
|
[m_cocoaNSView release];
|
||||||
if(m_parent)
|
if(m_parent)
|
||||||
m_parent->CocoaAddChild(this);
|
m_parent->CocoaAddChild(this);
|
||||||
return true;
|
return true;
|
||||||
@ -35,6 +39,7 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID winid,
|
|||||||
wxStaticBitmap::~wxStaticBitmap()
|
wxStaticBitmap::~wxStaticBitmap()
|
||||||
{
|
{
|
||||||
CocoaRemoveFromParent();
|
CocoaRemoveFromParent();
|
||||||
|
SetNSView(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxStaticBitmap::SetIcon(const wxIcon& icon)
|
void wxStaticBitmap::SetIcon(const wxIcon& icon)
|
||||||
|
Loading…
Reference in New Issue
Block a user