Avoid annoying prompt when closing MDI sample with one window
Ask the user when closing the window with several MDI frames opened, if only to demonstrate how to do it, but not if there is only one window as this is just too annoying when using the sample for testing.
This commit is contained in:
@@ -253,7 +253,7 @@ wxMenuBar *MyFrame::CreateMainMenubar()
|
||||
void MyFrame::OnClose(wxCloseEvent& event)
|
||||
{
|
||||
unsigned numChildren = MyChild::GetChildrenCount();
|
||||
if ( event.CanVeto() && (numChildren > 0) )
|
||||
if ( event.CanVeto() && (numChildren > 1) )
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf("%d windows still open, close anyhow?", numChildren);
|
||||
|
Reference in New Issue
Block a user