Search code examples
c++wxwidgets

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?


Solution

  • try

    wxEVT_COMMAND_LIST_ITEM_SELECTED