+extern bool g_blockEventsOnDrag;
+extern bool g_blockEventsOnScroll;
+
+
+
+//-----------------------------------------------------------------------------
+// Macro to tell which row the strings are in (1 if native checklist, 0 if not)
+//-----------------------------------------------------------------------------
+
+#if wxUSE_CHECKLISTBOX
+# define WXLISTBOX_DATACOLUMN_ARG(x) (x->m_hasCheckBoxes ? 1 : 0)
+#else
+# define WXLISTBOX_DATACOLUMN_ARG(x) (0)
+#endif // wxUSE_CHECKLISTBOX
+
+#define WXLISTBOX_DATACOLUMN WXLISTBOX_DATACOLUMN_ARG(this)
+
+// ----------------------------------------------------------------------------
+// helper functions
+// ----------------------------------------------------------------------------
+
+namespace
+{
+
+// Return the entry for the given listbox item.
+wxTreeEntry *
+GetEntry(GtkListStore *store, GtkTreeIter *iter, const wxListBox *listbox)
+{
+ wxTreeEntry* entry;
+ gtk_tree_model_get(GTK_TREE_MODEL(store),
+ iter,
+ WXLISTBOX_DATACOLUMN_ARG(listbox),
+ &entry,
+ -1);
+ g_object_unref(entry);
+ return entry;
+}
+
+} // anonymous namespace
+
+//-----------------------------------------------------------------------------
+// "row-activated"
+//-----------------------------------------------------------------------------
+
+extern "C" {
+static void
+gtk_listbox_row_activated_callback(GtkTreeView * WXUNUSED(treeview),
+ GtkTreePath *path,
+ GtkTreeViewColumn * WXUNUSED(col),
+ wxListBox *listbox)
+{
+ if (g_blockEventsOnDrag) return;
+ if (g_blockEventsOnScroll) return;
+
+ // This is triggered by either a double-click or a space press
+
+ int sel = gtk_tree_path_get_indices(path)[0];
+
+ listbox->GTKOnActivated(sel);
+}
+}