// headers
// ----------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "toplevelbase.h"
#endif
wxTopLevelWindowBase::wxTopLevelWindowBase()
{
+ // Unlike windows, top level windows are created hidden by default.
+ m_isShown = false;
}
wxTopLevelWindowBase::~wxTopLevelWindowBase()
bool shouldExit = IsLastBeforeExit();
wxTopLevelWindows.DeleteObject(this);
-
+
if ( shouldExit )
{
// then do it
if ( !wxPendingDelete.Member(this) )
wxPendingDelete.Append(this);
+ if (wxTopLevelWindows.GetCount() > 1)
+ {
+ // Hide it immediately. This should
+ // not be done if this TLW is the
+ // only one left since we then would
+ // risk not to get any idle events
+ // at all anymore during which we
+ // could delete any pending events.
+ Hide();
+ }
+
return TRUE;
}
{
// do we have _exactly_ one child?
wxWindow *child = (wxWindow *)NULL;
- for ( wxWindowList::Node *node = GetChildren().GetFirst();
+ for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
node;
node = node->GetNext() )
{