开发者

wxWidgets connect() not recognizing event type

I'm trying to connect a wxListCtrl event to a function in C++, and it should be straightforward. Generally using Connect() works, but for one reason or another, it isn't recognizing the event name (EVT_LIST_ITEM_SELECTED). I've included wx/listctrl.h, and even checked to make sure the event is listed (it is; not in listctrl, but in listbase which is included in listctrl).

Here is the problem line:

parent->Connect (ID_Objects, wxEVT_LIST_ITEM_SELECTED, (wxObjectEventFunction) &Editor::objectSelected);

The specific error is that identifier "wxEVT_LIST_ITEM_SELECTED" is开发者_运维知识库 undefined. The parent is a wxFrame.

In other places, I've used the same syntax but with a different event type and it worked fine.

So what am I doing wrong?


try

wxEVT_COMMAND_LIST_ITEM_SELECTED


Ensure that <wx/listctrl.h> is included in the file that contains parent->Connect (ID_Objects, wxEVT_LIST_ITEM_SELECTED, ...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜