Listing 5
// creating modeless dialog
wnd<some_dlg> d = create_dlg<some_dlg>(...);
// ok - when creating modeless dialog, the function
// returns after it's created and shown on screen
d.wait( some_signals );
// creating modal dialog (bad)
wnd<some_dlg> d = create_modal_dlg<some_dlg>(...);
// wrong - too late to wait for any signals, since
// the dialog has already been closed when we reach here!
d.wait( some_signals );
// creating modal dialog (good)
// we specify what signals to wait for at the
// window creation (the extra .wait(...) call)
wnd<some_dlg> d = create_modal_dlg<some_dlg>(...) .wait( some_signals);