- wxCHECK_RET( m_treeview != NULL, wxT("invalid listbox") );
-
- InvalidateBestSize();
-
- // Create and set column ids and GValues
-
- unsigned int nNum = items.GetCount();
- unsigned int nCurCount = wxListBox::GetCount();
- wxASSERT_MSG(pos <= nCurCount, wxT("Invalid index passed to wxListBox"));
-
- GtkTreeIter* pIter = NULL; // append by default
- GtkTreeIter iter;
- if (pos != nCurCount)
- {
- gboolean res = gtk_tree_model_iter_nth_child(
- GTK_TREE_MODEL(m_liststore),
- &iter, NULL, //NULL = parent = get first
- (int)pos );
- if(!res)
- {
- wxLogSysError(wxT("internal wxListBox error in insertion"));
- return;
- }
-
- pIter = &iter;
- }
-
- for (unsigned int i = 0; i < nNum; ++i)
- {
- wxString label = items[i];
-
- GtkTreeEntry* entry = gtk_tree_entry_new();
- gtk_tree_entry_set_label(entry, wxGTK_CONV(label));
- gtk_tree_entry_set_destroy_func(entry,
- (GtkTreeEntryDestroy)gtk_tree_entry_destroy_cb,
- this);