[wxMSW] [HEAD] New wxTaskBarIcon API doesn't seem to be working properly

Skip to first unread message

Ryan Norton

unread,
Jun 21, 2004, 2:53:29 PM6/21/04
to wx-...@lists.wxwindows.org
Hi,

On taskbaricon sample and my own apps nothing comes up when I
right-click on the task bar icon - not menu or anything.

I derived properly using CreatePopupMenu, and indeed the sample
doesn't work either - only double left-clicking works.

I guess I'll go back to the old message map way of doing it for now...

Ryan


Ryan Norton

unread,
Jun 21, 2004, 2:43:02 PM6/21/04
to wx-...@lists.wxwindows.org

Ryan Norton

unread,
Jun 21, 2004, 6:51:38 PM6/21/04
to wx-...@lists.wxwidgets.org
OK - this should help. The menu shows when the on right click
event is used (when TBFIXED isn't defined).

Nothing happens if TBFIXED is defined.

enum
{
WI_EXIT
};

class wxWikiServerIcon : public wxTaskBarIcon
{
public:
wxWikiServerIcon()
{
wxIcon icon(sample_xpm);
SetIcon( icon, wxT("WikiServer"));
}

void OnMenuExit(wxCommandEvent& evt);
#ifdef TBFIXED
virtual wxMenu* CreatePopupMenu()
{
wxMenu* menu = new wxMenu;
menu->Append(WI_EXIT, _T("E&xit"));
return menu;
}
#else
void wxWikiServerIcon::OnRButtonUp(wxTaskBarIconEvent&)
{
// wxIcon icon(wxT("wxDEFAULT_FRAME"));
wxMenu menu;
menu.Append(WI_EXIT, _T("E&xit"));
PopupMenu(&menu);
}
#endif
DECLARE_EVENT_TABLE();
};

BEGIN_EVENT_TABLE(wxWikiServerIcon, wxEvtHandler)
EVT_MENU(WI_EXIT, wxWikiServerIcon::OnMenuExit)
#ifndef TBFIXED
EVT_TASKBAR_RIGHT_UP (wxWikiServerIcon::OnRButtonUp)
#endif
END_EVENT_TABLE()

> --------------------------------------------------------------------
-
> To unsubscribe, e-mail: wx-dev-un...@lists.wxwidgets.org
> For additional commands, e-mail: wx-de...@lists.wxwidgets.org
>


Vaclav Slavik

unread,
Jul 2, 2004, 6:23:39 PM7/2/04
to wx-...@lists.wxwidgets.org
Hi,

Ryan Norton wrote:
> On taskbaricon sample and my own apps nothing comes up when I
> right-click on the task bar icon - not menu or anything.

Thanks! It's fixed in CVS (assuming you meant wxMSW).

Vaclav

--
PGP key: 0x465264C9, available from http://pgp.mit.edu/

Ryan Norton

unread,
Jul 3, 2004, 11:26:29 PM7/3/04
to wx-...@lists.wxwidgets.org
Hi Vaclav,

> > On taskbaricon sample and my own apps nothing comes up when I
> > right-click on the task bar icon - not menu or anything.
>Thanks! It's fixed in CVS (assuming you meant wxMSW).
Thanks Vaclav!

Ryan

P.S. Err - I do try to follow the subject line procedures :)

Reply all
Reply to author
Forward
0 new messages