X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dae73d7473aac7cabc3918c96a6d0103f17fdfc7..2a8db3cddacf2c3fc244f109fdecbba3b0dfc386:/samples/taskbar/tbtest.cpp diff --git a/samples/taskbar/tbtest.cpp b/samples/taskbar/tbtest.cpp index fd832b1e4d..3fdbc781a6 100644 --- a/samples/taskbar/tbtest.cpp +++ b/samples/taskbar/tbtest.cpp @@ -64,6 +64,9 @@ MyDialog::MyDialog(wxWindow* parent, const wxWindowID id, const wxString& title, MyDialog::~MyDialog() { delete m_taskBarIcon; +#if defined(__WXCOCOA__) + delete m_dockIcon; +#endif } void MyDialog::OnOK(wxCommandEvent& WXUNUSED(event)) @@ -94,6 +97,9 @@ void MyDialog::Init(void) Centre(wxBOTH); m_taskBarIcon = new MyTaskBarIcon(); +#if defined(__WXCOCOA__) + m_dockIcon = new MyTaskBarIcon(wxTaskBarIcon::DOCK); +#endif if (!m_taskBarIcon->SetIcon(wxICON(sample), wxT("wxTaskBarIcon Sample"))) wxMessageBox(wxT("Could not set icon.")); } @@ -110,7 +116,7 @@ BEGIN_EVENT_TABLE(MyTaskBarIcon, wxTaskBarIcon) EVT_MENU(PU_RESTORE, MyTaskBarIcon::OnMenuRestore) EVT_MENU(PU_EXIT, MyTaskBarIcon::OnMenuExit) EVT_MENU(PU_NEW_ICON,MyTaskBarIcon::OnMenuSetNewIcon) - EVT_TASKBAR_LEFT_DCLICK (MyTaskBarIcon::OnLButtonDClick) + EVT_TASKBAR_LEFT_DCLICK (MyTaskBarIcon::OnLeftButtonDClick) END_EVENT_TABLE() void MyTaskBarIcon::OnMenuRestore(wxCommandEvent& ) @@ -121,11 +127,6 @@ void MyTaskBarIcon::OnMenuRestore(wxCommandEvent& ) void MyTaskBarIcon::OnMenuExit(wxCommandEvent& ) { dialog->Close(true); - - // Nudge wxWidgets into destroying the dialog, since - // with a hidden window no messages will get sent to put - // it into idle processing. - wxGetApp().ProcessIdle(); } void MyTaskBarIcon::OnMenuSetNewIcon(wxCommandEvent&) @@ -148,7 +149,7 @@ wxMenu *MyTaskBarIcon::CreatePopupMenu() return menu; } -void MyTaskBarIcon::OnLButtonDClick(wxEvent&) +void MyTaskBarIcon::OnLeftButtonDClick(wxTaskBarIconEvent&) { dialog->Show(true); }