From 0021653f7eb4311184d19fac268c798fe998b53c Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Thu, 17 Apr 2014 15:21:42 +0000 Subject: [PATCH] use correct signature for callback git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76363 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/listbox.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index 9db502ae2e..7407fcf5ed 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -195,11 +195,10 @@ static void tree_entry_destroy_cb(wxTreeEntry* entry, //----------------------------------------------------------------------------- extern "C" { -static gint gtk_listbox_sort_callback(GtkTreeModel * WXUNUSED(model), - GtkTreeIter *a, - GtkTreeIter *b, - wxListBox *listbox) +static int +sort_callback(GtkTreeModel*, GtkTreeIter* a, GtkTreeIter* b, void* data) { + wxListBox* listbox = static_cast(data); wxTreeEntry* entry1 = GetEntry(listbox->m_liststore, a, listbox); wxCHECK_MSG(entry1, 0, wxT("Could not get first entry")); @@ -218,12 +217,10 @@ static gint gtk_listbox_sort_callback(GtkTreeModel * WXUNUSED(model), //----------------------------------------------------------------------------- extern "C" { -static gboolean gtk_listbox_searchequal_callback(GtkTreeModel * WXUNUSED(model), - gint WXUNUSED(column), - const gchar* key, - GtkTreeIter* iter, - wxListBox* listbox) +static gboolean +search_callback(GtkTreeModel*, int, const char* key, GtkTreeIter* iter, void* data) { + wxListBox* listbox = static_cast(data); wxTreeEntry* entry = GetEntry(listbox->m_liststore, iter, listbox); wxCHECK_MSG(entry, true, "could not get entry"); @@ -327,10 +324,7 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id, // NB: If this is enabled a doubleclick event (activate) gets sent // on a successful search gtk_tree_view_set_search_column(m_treeview, WXLISTBOX_DATACOLUMN); - gtk_tree_view_set_search_equal_func(m_treeview, - (GtkTreeViewSearchEqualFunc) gtk_listbox_searchequal_callback, - this, - NULL); + gtk_tree_view_set_search_equal_func(m_treeview, search_callback, this, NULL); gtk_tree_view_set_enable_search(m_treeview, FALSE); @@ -365,7 +359,7 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id, // Set the sort callback gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(m_liststore), WXLISTBOX_DATACOLUMN, - (GtkTreeIterCompareFunc) gtk_listbox_sort_callback, + sort_callback, this, //userdata NULL //"destroy notifier" );