]> git.saurik.com Git - wxWidgets.git/commitdiff
Allow creating initially hidden controls in wxOSX/Cocoa.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 21 Aug 2009 10:54:53 +0000 (10:54 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 21 Aug 2009 10:54:53 +0000 (10:54 +0000)
If wxWindow is hidden before being really created, we must create the native
control hidden too. Not only this allows to create the controls initially
hidden, as intended, but it also avoids the wx and native visibility flags
from getting out of sync which results in many other problems.

Closes #11131.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61725 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/cocoa/window.mm

index fed5b07659fc780a6786835a482d8013a7756440..7bf085d65b4190e22a534f651f56036045f77262 100644 (file)
@@ -1127,6 +1127,11 @@ wxWidgetCocoaImpl::wxWidgetCocoaImpl( wxWindowMac* peer , WXWidget w, bool isRoo
 {
     Init();
     m_osxView = w;
+
+    // check if the user wants to create the control initially hidden
+    if ( !peer->IsShown() )
+        SetVisibility(false);
+
     // gc aware handling
     if ( m_osxView )
         CFRetain(m_osxView);