I had tried DECLARE_EVENT_TABLE() && Connect(),but it dosen't work.My code just like this.How to make it work?
class MainFrameMenuBar :public wxMenuBar
//int id = XRCID("ID_MENU_FIGURE");
//Connect(id, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameMenuBar::onMenuItemFigure), NULL, this);
void MainFrameMenuBar::onMenuItemFigure(wxCommandEvent& event)
This used to be broken in older wxWidgets versions and you had to handle menu events only in the
wxFrame containing the menu bar and not the menu bar itself, but it should have been fixed quite some time ago, so perhaps you need to upgrade?
If you do use a version affected by that bug and can't upgrade, handling the events in the frame is the simplest workaround.