this, (&(EventHandlerRef&)m_pEventHandlerRef));
wxASSERT(err == noErr);
+
+ Connect(wxEVT_TASKBAR_RIGHT_DOWN, wxTaskBarIconEventHandler(wxTaskBarIcon::OnRightDown));
}
wxTaskBarIcon::~wxTaskBarIcon()
CGImageRef pImage;
-#if wxMAC_USE_CORE_GRAPHICS
+#if 0 // is always available under OSX now -- crashes on 10.2 in CFRetain() - RN
pImage = (CGImageRef) bmp.CGImageCreate() ;
#else
- wxMask* mask = bmp.GetMask();
- if (!mask)
+ WXHBITMAP iconport ;
+ WXHBITMAP maskport ;
+ iconport = bmp.GetHBITMAP( &maskport ) ;
+
+ if (!maskport)
{
// Make a mask with no transparent pixels
wxBitmap mbmp(icon.GetWidth(), icon.GetHeight());
dc.Clear();
dc.SelectObject(wxNullBitmap);
bmp.SetMask( new wxMask(mbmp, *wxWHITE) ) ;
+ iconport = bmp.GetHBITMAP( &maskport ) ;
}
//create the icon from the bitmap and mask bitmap contained within
- WXHBITMAP iconport ;
- WXHBITMAP maskport ;
- iconport = bmp.GetHBITMAP( &maskport ) ;
err = CreateCGImageFromPixMaps(
GetGWorldPixMap(MAC_WXHBITMAP(iconport)),
GetGWorldPixMap(MAC_WXHBITMAP(maskport)),
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