X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/69ecd30f312bef9440211df29ebd680622a10889..80d2803f703d1b238f42725504f08266ef02defe:/samples/taskbar/tbtest.cpp diff --git a/samples/taskbar/tbtest.cpp b/samples/taskbar/tbtest.cpp index 42ceee2723..45896485f1 100644 --- a/samples/taskbar/tbtest.cpp +++ b/samples/taskbar/tbtest.cpp @@ -17,10 +17,10 @@ #endif #ifndef WX_PRECOMP -#include "wx.h" +#include #endif -#include "wx/msw/taskbar.h" +#include #include "tbtest.h" // Declare two frames @@ -47,6 +47,7 @@ bool MyApp::OnInit(void) BEGIN_EVENT_TABLE(MyDialog, wxDialog) EVT_BUTTON(wxID_OK, MyDialog::OnOK) EVT_BUTTON(wxID_EXIT, MyDialog::OnExit) + EVT_CLOSE(MyDialog::OnCloseWindow) END_EVENT_TABLE() @@ -102,14 +103,19 @@ BEGIN_EVENT_TABLE(MyTaskBarIcon, wxTaskBarIcon) EVT_MENU(PU_EXIT, MyTaskBarIcon::OnMenuExit) END_EVENT_TABLE() -void MyTaskBarIcon::OnMenuRestore(wxEvent& ) +void MyTaskBarIcon::OnMenuRestore(wxCommandEvent& ) { dialog->Show(TRUE); } -void MyTaskBarIcon::OnMenuExit(wxEvent& ) +void MyTaskBarIcon::OnMenuExit(wxCommandEvent& ) { dialog->Close(TRUE); + + // Nudge wxWindows into destroying the dialog, since + // with a hidden window no messages will get sent to put + // it into idle processing. + wxGetApp().ProcessIdle(); }