+void wxToolBarTool::UpdateToggleImage( bool toggle )
+{
+#ifdef __WXMAC_OSX__
+ if ( toggle )
+ {
+ int w = m_bmpNormal.GetWidth() ;
+ int h = m_bmpNormal.GetHeight() ;
+ wxBitmap bmp( w , h ) ;
+ wxMemoryDC dc ;
+ dc.SelectObject( bmp ) ;
+ dc.SetPen( wxNullPen ) ;
+ dc.SetBackground( *wxWHITE ) ;
+ dc.DrawRectangle( 0 , 0 , w , h ) ;
+ dc.DrawBitmap( m_bmpNormal , 0 , 0 , true) ;
+ dc.SelectObject( wxNullBitmap ) ;
+ ControlButtonContentInfo info ;
+ wxMacCreateBitmapButton( &info , bmp ) ;
+ SetControlData( m_controlHandle , 0, kControlIconContentTag, sizeof( info ),
+ (Ptr)&info );
+ wxMacReleaseBitmapButton( &info ) ;
+ }
+ else
+ {
+ ControlButtonContentInfo info ;
+ wxMacCreateBitmapButton( &info , m_bmpNormal ) ;
+ SetControlData( m_controlHandle , 0, kControlIconContentTag, sizeof( info ),
+ (Ptr)&info );
+ wxMacReleaseBitmapButton( &info ) ;
+ }
+
+ IconTransformType transform = toggle ? kTransformSelected : kTransformNone ;
+ SetControlData( m_controlHandle, 0, kControlIconTransformTag, sizeof( transform ),
+ (Ptr)&transform );
+ HIViewSetNeedsDisplay( m_controlHandle , true ) ;
+
+#else
+ ::SetControl32BitValue( m_controlHandle , toggle ) ;
+#endif
+}