Re: GtkTreeView : why so many "refresh"



On Mon, Aug 11, 2003 at 04:53:53PM +0200, Francois MARTIN wrote: 
1. I have specified a function 'my_cell_data_func()' using
gtk_tree_view_column_set_cell_data_func() on each column of a view.
By calling gtk_tree_model_row_changed() on one of the rows of the model, I
am called into my_cell_data_func() for each column of the view for the
changed row (it's seem logical).
But, if the changed row is  visible (even partially), I am then called into
my_cell_data_func() again: for each visible rows and for each columns of
the view (including the changed row itself) ! Are these calls necessary ?
Note that there is no auto sort on the view, nor auto-resize on the
columns.

To avoid those calls the treeview would have to make a copy of your
data and store it inside the treeview; which would use a lot of memory 
and time and in most cases would not be useful.

If for some reason your data is too slow to access, you can create
your own cached copy and return that from the cell data func.

2. Is there a way to prevent 'my_cell_data_func()' from being called each
time the mouse pointer moves over a row (enters and leaves the row area in
fact), while keeping selection enabled ?

If the treeview doesn't copy your data, it has to ask for the data
each time it wants to display it.

If the treeview copied your data, there would be no point in using the
model-view architecture.

Note that you can also stuff all your data into one of the prebuilt
models such as GtkListStore, rather than using a cell_data_func();
that would give the behavior you're asking for.

Havoc



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