fix setting client data

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50913 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2007-12-24 01:53:34 +00:00
parent 50ccc908dc
commit cfe8a907fd

View File

@@ -33,7 +33,6 @@
#endif #endif
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// data // data
@@ -447,7 +446,7 @@ wxListBox::~wxListBox()
int wxListBox::DoInsertItems(const wxArrayStringsAdapter& items, int wxListBox::DoInsertItems(const wxArrayStringsAdapter& items,
unsigned int pos, unsigned int pos,
void **clientData, void **clientData,
wxClientDataType WXUNUSED(type)) wxClientDataType type)
{ {
wxCHECK_MSG( m_treeview != NULL, wxNOT_FOUND, wxT("invalid listbox") ); wxCHECK_MSG( m_treeview != NULL, wxNOT_FOUND, wxT("invalid listbox") );
@@ -472,15 +471,15 @@ int wxListBox::DoInsertItems(const wxArrayStringsAdapter& items,
(GtkTreeEntryDestroy)gtk_tree_entry_destroy_cb, (GtkTreeEntryDestroy)gtk_tree_entry_destroy_cb,
this); this);
if (clientData)
gtk_tree_entry_set_userdata(entry, clientData[i]);
GtkTreeIter itercur; GtkTreeIter itercur;
gtk_list_store_insert_before(m_liststore, &itercur, pIter); gtk_list_store_insert_before(m_liststore, &itercur, pIter);
GtkSetItem(itercur, entry); GtkSetItem(itercur, entry);
g_object_unref (entry); g_object_unref (entry);
if (clientData)
AssignNewItemClientData(GtkGetIndexFor(itercur), clientData, i, type);
} }
return pos + numItems - 1; return pos + numItems - 1;