bool wxMenu::Create(const wxString& title, long style)
{
-#if 0
- if(!title)
- return CocoaCreate("wxMenu");
-#endif
- return CocoaCreate(title);
+ wxAutoNSAutoreleasePool pool;
+ m_cocoaNSMenu = [[NSMenu alloc] initWithTitle: [NSString stringWithCString: title.c_str()]];
+ return true;
}
wxMenu::~wxMenu()
{
+ [m_cocoaNSMenu release];
}
bool wxMenu::DoAppend(wxMenuItem *item)
bool wxMenuBar::Create(long style)
{
- if(!CocoaCreate("wxMenuBar"))
- return false;
+ wxAutoNSAutoreleasePool pool;
+ m_cocoaNSMenu = [[NSMenu alloc] initWithTitle: @"wxMenuBar"];
+
NSMenuItem *dummyItem = [[NSMenuItem alloc] initWithTitle:@"App menu"
/* Note: title gets clobbered by app name anyway */
action:nil keyEquivalent:@""];
wxMenuBar::~wxMenuBar()
{
+ [m_cocoaNSMenu release];
}
bool wxMenuBar::Append( wxMenu *menu, const wxString &title )