- menu->SetEventHandler(this);
-
- //note to self - a MenuRef IS A MenuHandle
- MenuRef hMenu = MAC_WXHMENU(menu->GetHMenu());
-
- //When we call SetEventParameter it will decrement
- //the reference count of the menu - we need to make
- //sure it stays around in the wxMenu class here
- RetainMenu(hMenu);
-
- //set the actual dock menu
- OSStatus err = SetEventParameter((EventRef) m_pEvent, kEventParamMenuRef,
- typeMenuRef, sizeof(MenuRef),
- &hMenu);
- wxASSERT(err == 0);
-
- return err == noErr;
+
+ wxASSERT(menu);
+ m_pMenu->SetEventHandler(this);
+
+ return SetApplicationDockTileMenu(MAC_WXHMENU(menu->GetHMenu()));