Re: Please, help-me, show itens selected in tree_view



Oops, my code was not correct, the list was not freed :-(
Here is a new (and hopefully better) version:

GtkTreeModel *model2 = GTK_TREE_MODEL (model);
CList *l = gtk_tree_selection_get_selected_rows (tree_view);
GtkTreePath *path;
GtkTreeIter iter;
char *str;
GList *list = l;
while (l) {
	path = GTK_TREE_PATH (l->data);
	gtk_tree_model_get_iter (model2, &iter, path);
	gtk_model_get (model, &iter, 0, &str, -1);
	g_print (str);
	g_free (str);
	l = l->next;
}
g_list_foreach (list, gtk_tree_path_free, NULL);
g_list_free (list);

Attachment: signature.asc
Description: Ceci est une partie de message =?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]