Re: GtkTreeView very slow for large lists



On 12/16/2011 05:54 AM, jcupitt gmail com wrote:
...

I did notice that you forgot to put the treeview into fixed-height mode.

Normally, treeview lets rows vary in height (so you can change font
between rows, for example). To make this work, treeview has a idle
task which scans the entire model after it's been realized and
calculates a total height for the view, updating an initial guess.
This is the thing that's causing your terrible performance problems.

On my elderly desktop I see your test window almost immediately, but
it takes 50s for the CPU to drop to zero as it requests the height of
every row. If i add this line after creating the columns:

    gtk_tree_view_set_fixed_height_mode (GTK_TREE_VIEW (list), TRUE);

The window appears instantly and there is no background CPU churn.

John

Aha!  Thank you, that is what I was missing.  Problem solved.

-- John



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