Re: Treeview help needed
- From: Vadim Berezniker <vadim berezniker com>
- To: wilfried kopp wanadoo fr
- Cc: gtk-list gnome org
- Subject: Re: Treeview help needed
- Date: Mon, 18 Aug 2003 00:33:33 -0400
wilfried kopp wrote:
I am stuck with a segmentation fault caused by a treeview and I have pent hours trying to figure out what's wrong with no success.
Here is how I create the model (I simplified the code... but this version crashes as well...)
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
MIME_TYPES_TO_SKIP_COLUMN_STATE, 0 ,
That looks OK.
The segmentation fault happens when I remove an item with this code:
Why are you using constants such as (MIME_TYPES_TO_SKIP_COLUMN_STATE and
MIME_TYPES_TO_SKIP_COLUMN_MIME_TYPE) in the code that adds data but
referencing them by number here. This could lead to problems if the
constants change later.
if (gtk_tree_selection_get_selected (listSelection, NULL, &iter))
gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
Here is what ddd says:
(gtktalog:5396): Gtk-CRITICAL **: file ../../gtk/gtkliststore.c: line 566 (gtk_list_store_get_value): assertion `GTK_LIST_STORE (tree_model)->stamp == iter->stamp' failed
The error seems to indicate that you modified the model after retrieving
the iterator, which invalidates the iterator.
] [Thread Prev