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:
@@ -55,7 +55,9 @@ protected:
|
||||
wxMenu* m_pMenu;
|
||||
WXHMENU m_theLastMenu;
|
||||
bool m_iconAdded;
|
||||
|
||||
|
||||
void OnRightDown(wxTaskBarIconEvent& evt);
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxTaskBarIcon)
|
||||
};
|
||||
#endif
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user