X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/da0634c1401743089b1d8be20f9b6bdad0e8085b..42c37decc53971441199dfe4d8adf7fb842b2336:/src/cocoa/choice.mm diff --git a/src/cocoa/choice.mm b/src/cocoa/choice.mm index 2f16f831fc..dad736da5a 100644 --- a/src/cocoa/choice.mm +++ b/src/cocoa/choice.mm @@ -13,6 +13,8 @@ #include "wx/choice.h" #include "wx/log.h" +#import + IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl) BEGIN_EVENT_TABLE(wxChoice, wxChoiceBase) END_EVENT_TABLE() @@ -29,8 +31,14 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID winid, if(!CreateControl(parent,winid,pos,size,style,validator,name)) return false; + SetNSView([[NSPopUpButton alloc] initWithFrame:MakeDefaultNSRect(size) + pullsDown: NO]); + + [m_cocoaNSView sizeToFit]; if(m_parent) m_parent->CocoaAddChild(this); + SetInitialFrameRect(pos,size); + return true; } @@ -76,6 +84,11 @@ int wxChoice::DoAppend(const wxString&) return 0; } +int wxChoice::DoInsert(const wxString&, int) +{ + return 0; +} + void wxChoice::DoSetItemClientData(int, void*) { }