]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/forty/scoredg.cpp
second try...
[wxWidgets.git] / samples / forty / scoredg.cpp
index befb3725cdca16033ec08496915fd3772a41a503..de7d7a6a09d1b496a6e23b1915e5ac5ac9c28c22 100644 (file)
@@ -137,6 +137,9 @@ void ScoreCanvas::OnDraw(wxDC& dc)
        }
 }
 
+BEGIN_EVENT_TABLE(ScoreDialog, wxDialog)
+    EVT_CLOSE(ScoreDialog::OnCloseWindow)
+END_EVENT_TABLE()
 
 ScoreDialog::ScoreDialog(
                                                        wxWindow* parent,
@@ -183,10 +186,7 @@ void ScoreDialog::Display()
        Show(TRUE);
 }
 
-bool ScoreDialog::OnClose()
+void ScoreDialog::OnCloseWindow(wxCloseEvent& event)
 {
-       // hide the dialog
-       // NB don't return TRUE otherwise delete is called
-       Show(FALSE);
-       return FALSE;
+    EndModal(wxID_OK);
 }