hello all ! I need delete one or severals rows on GtkTreeView depending of action user. I use gtk+-2.0, libglade2, gnome2 !! static void remove_item (GtkButton *button, gpointer user_data) { HOW DELETE SIMPLE/MULTIPLE SELECTION ?? ANYONE COULD CREATE A SAMPLE?? } int main (int argc, char *argv[]) { Marc21EditorGui *gui; GtkTreeModel *model; ... /* MY TREEVIEW WIDGET */ model = create_model(); gui->treeview = GTK_TREE_VIEW (glade_xml_get_widget (gui->xml, "treeview")); gtk_tree_view_set_model(gui->treeview, model); g_object_unref (G_OBJECT (model)); gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (gui->treeview), TRUE); gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW (gui->treeview)), GTK_SELECTION_MULTIPLE); add_columns (GTK_TREE_VIEW (gui->treeview)); g_signal_connect (G_OBJECT (gui->treeview), "realize", G_CALLBACK (gtk_tree_view_expand_all), NULL); /* MY DELETE BUTTON */ gui->cmdRemoveItem = GTK_BUTTON (glade_xml_get_widget (gui->xml, "cmdRemoveItem")); g_signal_connect (G_OBJECT (gui->cmdRemoveItem), "clicked", G_CALLBACK(remove_item), gui->treeview); ... ... } The file attached represent this code; Have fun! -- Fernando Alencar Maróstica Graduate Student, Computer Science Linux Register User Id #281457 University Methodist of Piracicaba Departament of Computer Science email: famarost unimep br homepage: http://www.unimep.br/~famarost
Attachment:
gtktreeview.png
Description: PNG image