diff --git a/include/wx/generic/infobar.h b/include/wx/generic/infobar.h index 79e1c683fe..db57ea31b1 100644 --- a/include/wx/generic/infobar.h +++ b/include/wx/generic/infobar.h @@ -114,6 +114,7 @@ private: // the original parent background colour, before we changed it wxColour m_origParentBgCol; + DECLARE_EVENT_TABLE() wxDECLARE_NO_COPY_CLASS(wxInfoBarGeneric); }; diff --git a/src/generic/infobar.cpp b/src/generic/infobar.cpp index 42f1daf56e..3b9c6b64cb 100644 --- a/src/generic/infobar.cpp +++ b/src/generic/infobar.cpp @@ -39,6 +39,10 @@ #include "wx/scopeguard.h" #include "wx/sizer.h" +BEGIN_EVENT_TABLE(wxInfoBarGeneric, wxInfoBarBase) + EVT_BUTTON(wxID_ANY, wxInfoBarGeneric::OnButton) +END_EVENT_TABLE() + // ============================================================================ // implementation // ============================================================================ @@ -89,14 +93,6 @@ bool wxInfoBarGeneric::Create(wxWindow *parent, wxWindowID winid) ); m_button->SetToolTip(_("Hide this notification message.")); - Connect - ( - wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(wxInfoBarGeneric::OnButton), - NULL, - this - ); - // center the text inside the sizer with an icon to the left of it and a // button at the very right //