Re: Please, help-me, show itens selected in tree_view
- From: Ranieri <ranieri_savage yahoo com br>
- To: gtk-list gnome org
- Subject: Re: Please, help-me, show itens selected in tree_view
- Date: Wed, 16 Jun 2004 00:40:17 -0300
This code was not correct.
The error message is:
test.c: In function `main':
test.c:55: `CList' undeclared (first use in this function)
test.c:55: (Each undeclared identifier is reported only once
test.c:55: for each function it appears in.)
test.c:55: `l' undeclared (first use in this function)
test.c:55: warning: passing arg 1 of
`gtk_tree_selection_get_selected_rows'
from incompatible pointer type
test.c:55: too few arguments to function
`gtk_tree_selection_get_selected_rows'
test.c:57: redeclaration of `iter'
test.c:13: `iter' previously declared here
test.c:61: warning: assignment makes pointer from integer without a cast
test.c:68: warning: passing arg 2 of `g_list_foreach' from incompatible
pointer type
The GTK_TREE_MODEL and gtk_model_get exist ?
Jean Bréfort wrote:
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]