+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
+ if ( HIThemeSetFill != 0 )
+ {
+ HIThemeSetFill( m_backgroundBrush.MacGetTheme() , cg ) ;
+ CGContextFillRect(cg, rect);
+
+ }
+ else
+#endif
+ {
+ RGBColor color;
+ GetThemeBrushAsColor( m_backgroundBrush.MacGetTheme() , 32, true, &color );
+ CGContextSetRGBFillColor( cg , (float) color.red / 65536,
+ (float) color.green / 65536, (float) color.blue / 65536, 1 );
+ CGContextFillRect( cg, rect );
+ }
+ // reset to normal value
+ RGBColor col = MAC_WXCOLORREF( GetBrush().GetColour().GetPixel() ) ;
+ CGContextSetRGBFillColor( cg , col.red / 65536.0 , col.green / 65536.0 , col.blue / 65536.0 , 1.0 ) ;