Opened 9 years ago

Closed 9 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

Description

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 )
{

EnsureIsValid();

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 );

#if wxOSX_USE_CARBON

PlotIconRefInContext( m_cgContext , &r , kAlignNone , kTransformNone ,

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

#endif

CGContextRestoreGState( m_cgContext );

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

Change History (1)

comment:1 Changed 9 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.