- GtkTreeIter* pIter = NULL; // append by default
- GtkTreeIter iter;
- if ( pos != GetCount() )
- {
- wxCHECK_MSG( GTKGetIteratorFor(pos, &iter), wxNOT_FOUND,
- wxT("internal wxListBox error in insertion") );
-
- pIter = &iter;
- }
-
- const unsigned int numItems = items.GetCount();
- for ( unsigned int i = 0; i < numItems; ++i )
- {
- wxGtkObject<GtkTreeEntry> entry(gtk_tree_entry_new());
- gtk_tree_entry_set_label(entry, wxGTK_CONV(items[i]));
- gtk_tree_entry_set_destroy_func(entry,
- (GtkTreeEntryDestroy)gtk_tree_entry_destroy_cb,
- this);
-
- GtkTreeIter itercur;
- gtk_list_store_insert_before(m_liststore, &itercur, pIter);
-
- GTKSetItem(itercur, entry);
-
- if (clientData)
- AssignNewItemClientData(GTKGetIndexFor(itercur), clientData, i, type);
- }
+int wxListBox::DoInsertOneItem(const wxString& item, unsigned int pos)
+{
+ wxTreeEntry* entry = wx_tree_entry_new();
+ wx_tree_entry_set_label(entry, wxGTK_CONV(item));
+ wx_tree_entry_set_destroy_func(entry, (wxTreeEntryDestroy)tree_entry_destroy_cb, this);