Re: Unexplainable crashes with GtkTreeModelSort



On Fri, 16 Jan 2004 09:30:00 -0800
Dimitar Haralanov <voidtrance comcast net> wrote:

The problem when I try to use the mouse wheel to select different rows
of the GtkTreeView (see function below). Basically, my logic is as
follows: I find the currently active row in the sorted model, I
advance the path one up/down (depending on the direction of the
scroll) in the sorted model, then I get the corresponding iter in the
sorted tree. After that I conver the new iter to the corresponding
iter in the original, unsorted model and I change a column value there
to indicate that it is the new active row.    However, every single time
I use the wheel I get the following errors and crash:

        I think that I might have found where the problem stems from...
According to the documentation, gtk_tree_path_next advances the path
pointer to the next path. However, it never checks whether it is valid
or even exists. Therefore, when I use gtk_tree_model_get_iter
with the invalid path, I get a crash. 

        Considering that this is not the behaviour of gtk_tree_path_prev, I
consider this to be a major bug in GTK.

        If this is not a bug but an intended feature, please, someone tell me
how to guard against using invalid paths...


-- 
Mitko Haralanov
voidtrance at comcast dot net
http://voidtrance.home.comcast.net
==========================================
75. I think it should not be doing that...

        --Top 100 things you don't want the sysadmin to say

Attachment: pgpFvHBeHrsJF.pgp
Description: PGP signature



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