Create an NSView in leiu of a real listbox
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19775 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -13,6 +13,8 @@
|
|||||||
#include "wx/listbox.h"
|
#include "wx/listbox.h"
|
||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
|
|
||||||
|
#import <AppKit/NSView.h>
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
|
IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
|
||||||
BEGIN_EVENT_TABLE(wxListBox, wxListBoxBase)
|
BEGIN_EVENT_TABLE(wxListBox, wxListBoxBase)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
@@ -29,6 +31,9 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID winid,
|
|||||||
if(!CreateControl(parent,winid,pos,size,style,validator,name))
|
if(!CreateControl(parent,winid,pos,size,style,validator,name))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
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;
|
||||||
@@ -37,6 +42,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID winid,
|
|||||||
wxListBox::~wxListBox()
|
wxListBox::~wxListBox()
|
||||||
{
|
{
|
||||||
CocoaRemoveFromParent();
|
CocoaRemoveFromParent();
|
||||||
|
SetNSView(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// pure virtuals from wxListBoxBase
|
// pure virtuals from wxListBoxBase
|
||||||
|
Reference in New Issue
Block a user