+ SetNSView([[NSPopUpButton alloc] initWithFrame:MakeDefaultNSRect(size)
+ pullsDown: NO]);
+ [m_cocoaNSView release];
+
+ NSMenu *nsmenu = [(NSPopUpButton*)m_cocoaNSView menu];
+ AssociateNSMenu(nsmenu, OBSERVE_DidSendAction);
+
+ if(style&wxCB_SORT)
+ {
+ m_sortedStrings = new wxSortedArrayString;
+ for(int i=0; i<n; i++)
+ {
+ m_sortedStrings->Add(choices[i]);
+ }
+ for(unsigned int i=0; i < m_sortedStrings->GetCount(); i++)
+ {
+ [nsmenu addItemWithTitle:wxNSStringWithWxString(
+ m_sortedStrings->Item(i))
+ action: nil keyEquivalent:@""];
+ }
+ }
+ else
+ {
+ for(int i=0; i<n; i++)
+ {
+ [nsmenu addItemWithTitle:wxNSStringWithWxString(choices[i])
+ action: nil keyEquivalent:@""];
+ }
+ }
+ m_itemsClientData.SetCount(n);
+
+ [(NSPopUpButton*)m_cocoaNSView sizeToFit];