diff --git a/eeschema/dialogs/dialog_choose_component.cpp b/eeschema/dialogs/dialog_choose_component.cpp
index 1efa8dc..e46b54c 100644
--- a/eeschema/dialogs/dialog_choose_component.cpp
+++ b/eeschema/dialogs/dialog_choose_component.cpp
@@ -260,7 +260,11 @@ void DIALOG_CHOOSE_COMPONENT::SelectIfValid( const wxDataViewItem& aTreeId )
 
 void DIALOG_CHOOSE_COMPONENT::PostSelectEvent()
 {
+#if wxCHECK_VERSION( 3, 1, 1 )
+    wxDataViewEvent evt;
+#else
     wxDataViewEvent evt( wxEVT_DATAVIEW_SELECTION_CHANGED );
+#endif
     m_tree_ctrl->GetEventHandler()->ProcessEvent( evt );
 }
 
