#include "wx/log.h"
#endif // WX_PRECOMP
+#include "wx/cocoa/autorelease.h"
+
#import <Foundation/NSString.h>
#import <AppKit/NSMenu.h>
bool wxMenu::DoAppend(wxMenuItem *item)
{
+ wxAutoNSAutoreleasePool pool;
if(!wxMenuBase::DoAppend(item))
return false;
[m_cocoaNSMenu addItem: item->GetNSMenuItem()];
bool wxMenu::DoInsert(unsigned long pos, wxMenuItem *item)
{
+ wxAutoNSAutoreleasePool pool;
if(!wxMenuBase::DoInsert(pos,item))
return false;
[m_cocoaNSMenu insertItem:item->GetNSMenuItem() atIndex:pos];
wxMenuItem* wxMenu::DoRemove(wxMenuItem *item)
{
+ wxAutoNSAutoreleasePool pool;
wxMenuItem *retitem = wxMenuBase::DoRemove(item);
wxASSERT(retitem->GetNSMenuItem());
[m_cocoaNSMenu removeItem:retitem->GetNSMenuItem()];
bool wxMenuBar::Append( wxMenu *menu, const wxString &title )
{
+ wxAutoNSAutoreleasePool pool;
wxLogDebug("append menu=%p, title=%s",menu,title.c_str());
if(!wxMenuBarBase::Append(menu,title))
return false;
bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title)
{
+ wxAutoNSAutoreleasePool pool;
wxLogDebug("insert pos=%lu, menu=%p, title=%s",pos,menu,title.c_str());
if(!wxMenuBarBase::Insert(pos,menu,title))
return false;
void wxMenuBar::Attach(wxFrame *frame)
{
+ wxMenuBarBase::Attach(frame);
}
void wxMenuBar::Detach()
{
+ wxMenuBarBase::Detach();
}
wxSize wxMenuBar::DoGetBestClientSize() const