+ wxCHECK_RET( IsValid(n), wxT("invalid index in wxListBox::SetString") );
+ wxCHECK_RET( m_treeview != NULL, wxT("invalid listbox") );
+
+ GtkTreeEntry* entry = GtkGetEntry(n);
+ wxCHECK_RET( entry, wxT("wrong listbox index") );
+
+ // update the item itself
+ gtk_tree_entry_set_label(entry, wxGTK_CONV(label));
+
+ // and update the model which will refresh the tree too
+ GtkTreeIter iter;
+ wxCHECK_RET( GtkGetIteratorFor(n, &iter), _T("failed to get iterator") );
+
+ // FIXME: this resets the checked status of a wxCheckListBox item
+
+ GtkSetItem(iter, entry);
+}
+
+wxString wxListBox::GetString(unsigned int n) const
+{
+ wxCHECK_MSG( m_treeview != NULL, wxEmptyString, wxT("invalid listbox") );
+
+ GtkTreeEntry* entry = GtkGetEntry(n);
+ wxCHECK_MSG( entry, wxEmptyString, wxT("wrong listbox index") );
+
+ wxString label = wxGTK_CONV_BACK( gtk_tree_entry_get_label(entry) );
+
+ g_object_unref (entry);
+ return label;
+}
+
+unsigned int wxListBox::GetCount() const
+{
+ wxCHECK_MSG( m_treeview != NULL, 0, wxT("invalid listbox") );
+
+ return (unsigned int)gtk_tree_model_iter_n_children(GTK_TREE_MODEL(m_liststore), NULL);
+}
+
+int wxListBox::FindString( const wxString &item, bool bCase ) const
+{
+ wxCHECK_MSG( m_treeview != NULL, wxNOT_FOUND, wxT("invalid listbox") );
+
+ //Sort of hackish - maybe there is a faster way
+ unsigned int nCount = wxListBox::GetCount();
+
+ for(unsigned int i = 0; i < nCount; ++i)