Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / wxTaskBarIconEvent

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. wxTaskBarIconEvent
#4677
Posted by: 2004-06-29 23:19:06
wxWidgets 2.4.2, wxMSW version
I'm trying to register events from a task bar icon that i want to handle in the main frame of the app, but the connection just doesn't work.

event table is

BEGIN_EVENT_TABLE(MyFrame, wxFrame)
    EVT_CLOSE(Minimal_Quit, MyFrame::OnQuit)
    EVT_TIMER(Timer_ID, MyFrame::OnTimer)
    EVT_ICONIZE(MyFrame::OnIconize)
    EVT_TASKBAR_LEFT_UP(MyFrame::OnSwitchIconize)
    EVT_TASKBAR_RIGHT_DCLICK(MyFrame::OnClose)
END_EVENT_TABLE()
but OnSwitchIconize and OnClose are never called.

Both functions are declared as follows in the header file:
class MyFrame : public wxFrame
{
public:
    void OnClose(wxTaskBarIconEvent & event);
    void OnSwitchIconize(wxTaskBarIconEvent & event);
}
Is there a mistake?
Should i derive MyFrame from wxTaskBarIcon?
Message2. Re: wxTaskBarIconEvent
#4680
Posted by: upCASE 2004-06-30 00:11:31
Hi!
Derive your taskbaricon from wxTaskBarIcon, do the event handling in you dervied class and create the new class in your frame.
Check the "taskbar" sample for a way to do that. http://g.yi.org/f.php?f=7880
upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message3. Re: wxTaskBarIconEvent
#4681
Posted by: 2004-06-30 00:27:24
Thanks.
I had noticed that thing in the example, but being a bit lazy i didn't want to bother with that ;)
(i'm porting an app from Py/wxPy to C++/wxW and wxPy allows you to handle TaskBarIconEvents into the app frame, which is why i was trying it that way)
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
¥860.00 ·
 
 
¥900.00 ·
 
 
¥810.00 ·
 
 
¥317.00 ·
 
 
¥1,370.00 ·
 
 
¥660.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0