cgimagecreate from wxbitmap crashes 10.2 - turn off. Put in right click handler to avoid double-creation of the menus

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32699 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Ryan Norton
2005-03-09 18:54:52 +00:00
parent 099c3b27c2
commit b14ba1f117
2 changed files with 12 additions and 2 deletions

View File

@@ -56,6 +56,8 @@ protected:
WXHMENU m_theLastMenu;
bool m_iconAdded;
void OnRightDown(wxTaskBarIconEvent& evt);
DECLARE_DYNAMIC_CLASS(wxTaskBarIcon)
};
#endif

View File

@@ -143,6 +143,8 @@ wxTaskBarIcon::wxTaskBarIcon(const wxTaskBarIconType& nType)
this, (&(EventHandlerRef&)m_pEventHandlerRef));
wxASSERT(err == noErr);
Connect(wxEVT_TASKBAR_RIGHT_DOWN, wxTaskBarIconEventHandler(wxTaskBarIcon::OnRightDown));
}
wxTaskBarIcon::~wxTaskBarIcon()
@@ -181,7 +183,7 @@ bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip)
CGImageRef pImage;
#if 1 // is always available under OSX now
#if 0 // is always available under OSX now -- crashes on 10.2 in CFRetain() - RN
pImage = (CGImageRef) bmp.CGImageCreate() ;
#else
WXHBITMAP iconport ;
@@ -289,4 +291,10 @@ bool wxTaskBarIcon::PopupMenu(wxMenu *menu)
return true;
}
//Skip the event so that popupmenu isn't called in parent, avoiding double-creation of the menus
void wxTaskBarIcon::OnRightDown(wxTaskBarIconEvent& evt)
{
evt.Skip();
}
#endif //wxHAS_TASK_BAR_ICON