Re: gtk_tree_view_get_visible_range



What do you exactly expect from gtk_tree_view_get_visible_range()
when the tree view is not realized, has no size allocated,
etc. (beside a more helpful error message)?  What is
*visible* then?

I probably expect FALSE again but I suppose the current behaviour is OK

The errors disappear if you do for example

    GtkWidget *window;
    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
    gtk_widget_show_all(window);

first.

Not for me they don't.
But further research shows that also adding
while(gtk_events_pending()) gtk_main_iteration();
just above the gtk_tree_view_get_visible_range does work.

Oddly the original full program is also fixed by doing this - presumably the problem function somehow gets called from a place where the list has just been modified so random important bookkeeping of some sort hasn't happened - still odd, and a more helpful error message, like "Your treeview is an inconsistent state, please don't call me from here" would have been nice.

Thanks for providing 4/5 of the code that made the testcase work.




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