Re: Copy GtkListStore



20/04/2006 в 16:20 +0200, David Necas (Yeti) wrote:
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.


Thanks, this works!

-- 
Dubravin Andrey <daa84 inbox ru>




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