How to know have we opened child dialogs

Vadim Zeitlin vadim at wxwidgets.org
Sun Apr 6 09:50:14 PDT 2008


On Sun, 06 Apr 2008 19:21:56 +0300 Tyushkov Nikolay <wx at softvoile.com> wrote:

TN> > TN> Is there a way to determine has my window opened child dialogs?  
TN> >
TN> >  Not easily... The only thing which comes to mind is to scan
TN> > wxTopLevelWindows list and check if there are any windows in it with your
TN> > top frame as parent.
TN> >   
TN> Did you  mean something like this?
TN> 
TN>         wxWindowList::Node* node = wxTopLevelWindows.GetFirst();
TN>         while (node)
TN>         {
TN>             wxWindow* window = (wxWindow*)node->GetData();
TN>             if (window)
TN>             {
TN>                  ...
TN>             }
TN>             node = node->GetNext();
TN>         }

 Yes.

TN> There is not much information about wxTopLevelWindows,

 It's just a list of all top level windows (and there are no NULL pointers
in it FWIW).

TN> but it seems (and my experiments confirm) that, wxTopLevelWindows has
TN> no information about native dialogs.

 This probably could be corrected... but native dialogs are tricky as we
don't control their creation so it would require some effort.

 Regards,
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/



More information about the wx-users mailing list