Re: Copy GtkListStore



On Thu, Apr 20, 2006 at 05:42:51PM +0400, Dubravin Andrey wrote:
How to create copy of GtkListStore, not object reference? Need to create
copy of all data in GtkListStory.

Get the number of columns with gtk_tree_model_get_n_columns()
and their types with gtk_tree_model_get_column_type(),
create a new list store with gtk_list_store_newv().
Iterate over rows, in each row iterate over columns, fetch
values with the generic method gtk_tree_model_get_value()
ans store them with gtk_list_store_set_value().

Of course, the copy will be be still shallow.  If you want
a deep copy, you have to know how to deep-copy values like
objects or raw pointers (which is generally impossible) if
they can be present.

Yeti


--
That's enough.



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