gtk_tree_view_get_visible_range



My previous email on this subject was rubbish and unspecific, sorry for the spam. So - I have reduced my code down to the smallest test case and now hope someone can help me.


#include "gtk/gtk.h"
int main(int argc, char **argv)
{
        gtk_init(&argc, &argv);

        //make a store and view stick them together, add a column
        GtkListStore* store=gtk_list_store_new(1,G_TYPE_STRING);
        GtkTreeView* view=(GtkTreeView*)gtk_tree_view_new();
        gtk_tree_view_set_model(view,(GtkTreeModel*)store);
        GtkTreeViewColumn* column=gtk_tree_view_column_new();
        gtk_tree_view_append_column(view,column);

        //check get_visible_range, all is well
        GtkTreePath* sp;
        GtkTreePath* ep;
        gtk_tree_view_get_visible_range(view,&sp,&ep);
                
        //add one row
        GtkTreeIter iter;
        gtk_list_store_append(store,&iter);
        gtk_list_store_set(store,&iter,0,"foo",-1);
                
        //check again, bad things
        gtk_tree_view_get_visible_range(view,&sp,&ep);
}


The errors are:

(a.out:5709): Gtk-CRITICAL **: _gtk_tree_view_find_path: assertion `node != NULL' failed

(a.out:5709): Gtk-CRITICAL **: _gtk_tree_view_find_path: assertion `node != NULL' failed

As I said before - in the full version everything seems to work as expected except for these errors.



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