Re: Implementing GtkTreeModels



Mariano Suarez-Alvarez <msuarezalvarez arnet com ar> writes:

> Hi all,
> 
> There is a question at the end. Bear with me a little intro:
> 
> Most of the time I use GtkTreeStore or GtkListStore, the data that will
> get displayed is stored somewhere, most probably some structs. Filling
> in the rows of the store ends up in quite a bit of duplication. I
> usually do this, then, by setting up my own class implementing the
> GtkTreeModel iface.

If you're just storing structs then you probably don't need to make a
custom model.  Simply doing:

model = gtk_list_store_new (1, G_TYPE_POINTER);

in conjunction with gtk_tree_view_column_set_cell_data_func seems like
it will do everything you need.

Thanks,
-Jonathan



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