How delete Simple and Multiple Selection on GtkTreeView ??
- From: Fernando Alencar Maróstica <famarost unimep br>
- To: gtk-app-devel-list gnome org
- Subject: How delete Simple and Multiple Selection on GtkTreeView ??
- Date: 11 Dec 2002 01:41:40 -0200
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)
{
???
}
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]