Opened 10 years ago

Closed 10 years ago

#10490 closed defect (fixed)

wxIcon is not drawn on OSX (cocoa)

Reported by: hartwigw Owned by:
Priority: high Milestone:
Component: wxOSX Version: stable-latest
Keywords: wxIcon Cc:
Blocked By: Blocking:
Patch: no


Is there any reasons why the call to the function drawing the icon is excluded in cocoa? I just replaced wxOSX_USE_CARBON by wxOSX_USE_COCOA_OR_CARBON and everything works as expected.

void wxMacCoreGraphicsContext::DrawIcon( const wxIcon &icon, wxDouble x, wxDouble y, wxDouble w, wxDouble h )


CGRect r = CGRectMake( (CGFloat) 0.0 , (CGFloat) 0.0 , (CGFloat) w , (CGFloat) h );
CGContextSaveGState( m_cgContext );
CGContextTranslateCTM( m_cgContext,(CGFloat) x ,(CGFloat) (y + h) );
CGContextScaleCTM( m_cgContext, 1, -1 );


PlotIconRefInContext( m_cgContext , &r , kAlignNone , kTransformNone ,

NULL , kPlotIconRefNormalFlags , MAC_WXHICON( icon.GetHICON() ) );


CGContextRestoreGState( m_cgContext );

Therefore, icon cannot be drawn and copying icons into bitmaps fail.

Change History (1)

comment:1 Changed 10 years ago by SC

  • Resolution set to fixed
  • Status changed from new to closed

(In [58823]) supporting graphics context on invisible views, icon refs are available under 64 bit cocoa as well, turn drawing on again, fixes #10490

Note: See TracTickets for help on using tickets.