+ bool doClear = true ;
+ WindowRef window = GetMacRootWindow() ;
+ if ( window )
+ {
+ wxWindow* win = wxFindWinFromMacWindow( window ) ;
+ if ( win )
+ {
+ wxWindow* parent = GetParent() ;
+ while ( parent )
+ {
+ if( parent->MacGetWindowData() )
+ {
+ break ;
+ }
+
+ if( parent->IsKindOf( CLASSINFO( wxNotebook ) ) || parent->IsKindOf( CLASSINFO( wxTabCtrl ) ))
+ {
+ if ( ((wxControl*)parent)->GetMacControl() ) {
+ Rect rect = { -32767 , -32767 , 32767 , 32767 } ;
+ if ( DrawThemeTabPane != (void*)kUnresolvedCFragSymbolAddress )
+ {
+ DrawThemeTabPane ( &rect, kThemeStateActive);
+ doClear = false ;
+ }
+ }
+ break ;
+ }
+
+ parent = parent->GetParent() ;
+ }
+ }
+ }
+ if ( doClear )
+ dc.Clear() ;
+