+ wxCHECK_MSG( m_treeview != NULL, false, wxT("invalid listbox") );
+
+ GtkTreeSelection* selection = gtk_tree_view_get_selection(m_treeview);
+
+ GtkTreeIter iter;
+ wxCHECK_MSG( GtkGetIteratorFor(n, &iter), false, wxT("Invalid index") );
+
+ return gtk_tree_selection_iter_is_selected(selection, &iter);
+}
+
+void wxListBox::DoSetSelection( int n, bool select )
+{
+ // passing -1 to SetSelection() is documented to deselect all items
+ if ( n == wxNOT_FOUND )
+ {
+ // ... and not generate any events in the process
+ GtkDeselectAll();
+ return;
+ }
+
+ wxCHECK_RET( IsValid(n), wxT("invalid index in wxListBox::SetSelection") );
+
+ // don't generate the selection event
+ GtkSetSelection(n, select, true);
+}
+
+void wxListBox::GtkDeselectAll()
+{
+ wxCHECK_RET( m_treeview != NULL, wxT("invalid listbox") );
+
+ GtkTreeSelection* selection = gtk_tree_view_get_selection(m_treeview);
+
+ m_blockEvent = true;