From e89fc9c152cd29ac559700a3e7eb1f548d991121 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 30 Jan 2016 21:30:43 +0100 Subject: [PATCH] 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. --- samples/mdi/mdi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/mdi/mdi.cpp b/samples/mdi/mdi.cpp index e0195f0750..726bc8f18f 100644 --- a/samples/mdi/mdi.cpp +++ b/samples/mdi/mdi.cpp @@ -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);