From b175b96ba0ce7b657991465ce5cd2ca53e7ab7bc Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Mon, 5 Apr 2004 05:20:40 +0000 Subject: [PATCH] added recursive invalidation after a Thaw command git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26622 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/window.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index c6090ebd83..1f199792dc 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -1855,6 +1855,27 @@ void wxWindowMac::Freeze() #endif } +#if TARGET_API_MAC_OSX +static void InvalidateControlAndChildren( HIViewRef control ) +{ + HIViewSetNeedsDisplay( control , true ) ; + UInt16 childrenCount = 0 ; + OSStatus err = CountSubControls( control , &childrenCount ) ; + if ( err == errControlIsNotEmbedder ) + return ; + wxASSERT_MSG( err == noErr , wxT("Unexpected error when accessing subcontrols") ) ; + + for ( UInt16 i = childrenCount ; i >=1 ; --i ) + { + HIViewRef child ; + err = GetIndexedSubControl( control , i , & child ) ; + if ( err == errControlIsNotEmbedder ) + return ; + InvalidateControlAndChildren( child ) ; + } +} +#endif + void wxWindowMac::Thaw() { #if TARGET_API_MAC_OSX @@ -1863,7 +1884,8 @@ void wxWindowMac::Thaw() if ( !--m_frozenness ) { HIViewSetDrawingEnabled( (HIViewRef) m_macControl , true ) ; - HIViewSetNeedsDisplay( (HIViewRef) m_macControl , true ) ; + InvalidateControlAndChildren( (HIViewRef) m_macControl ) ; + // HIViewSetNeedsDisplay( (HIViewRef) m_macControl , true ) ; } #endif } -- 2.45.2