guile-gtk-general
[Top][All Lists]
Advanced

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

Re: Possible bug in guile-gtk-tree-model implementation


From: Stanislas Pinte
Subject: Re: Possible bug in guile-gtk-tree-model implementation
Date: Thu, 22 Mar 2007 15:03:35 +0100
User-agent: Thunderbird 1.5.0.10 (Windows/20070221)

Hello guys,

This problem came from a bug in my custom model implementation.

After modifying its internal filter, I was notifying the GtkTreeView
with row-deleted and row-inserted signals, but with buggy indexes.

Kind of logical.

Sorry for the hassle.

Stan.

Stanislas Pinte a écrit :
> Hello,
>
> I think that there is a bug in the guile-gtk-tree-model implementation,
> in the guile_gtk_generic_tree_model_get_iter function (see code below)
>
> I implemented a custom model in guile, with filtering capabilities. When
> I update my filter, and when the row count falls down to 0 (I.e. my
> filter filters out all elements), I get this error:
>
> test-filtered-model.scm:109:5: (application):
> guile_gtk_generic_tree_model_get_value: assertion `iter->user_data !=
> NULL' failed
>
> However, I have the impression my model is doing what it should:
>
> If I have 3 elements, upon updating my filter, my model calls
>
>     (row-deleted model (list source-index))
>
> three times.
>
> After that, the GtkTreeView tries to retrieve the first iter:
>
>     on-get-iter path: (0)
>     get-iter-at-index index 0
>
> My custom model returns #f, because the path (0) is not visible anymore.
> It may be a problem with the following lines in
> guile_gtk_generic_tree_model_get_iter implementation:
>
> if (SCM_NFALSEP (scm_ret)) {
>         SET_ITER_VAL (iter, scm_ret);
>         return TRUE;
>     } else {
>         SET_ITER_NULL (iter);
>         return FALSE;
>     }
>
> --> if scm_ret is #f, can I be sure that SCM_NFALSEP will return false?
>
> I wonder anyway why would the GtkTreeView try to retrieve the path (0)
> if it has seen 3 row-deleted events...
>
> Thanks in advance for your help ,
>
> Stan.
>
>
> _______________________________________________
> guile-gtk-general mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/guile-gtk-general
>
>   





reply via email to

[Prev in Thread] Current Thread [Next in Thread]