Re: dynamic gtk_list_store



On Mon, 14 Jun 2004 00:32:14 +0100
Tim Müller <zen18864 zen co uk> wrote:

  store = gtk_tree_view_get_model (view);
  gtk_tree_view_set_model (view, NULL);
  g_object_unref (store);

The second line will make the treeview drop its reference to the store 
(instead of NULL you can also use another store there), and the third
line will get rid of the initial reference from gtk_list_store_new().

Hi Tim.

Thanks... That helps.

Alternatively, you could just use a list store with a G_TYPE_POINTER
column or so, and store a custom struct there for each row, e.g.

struct _FooRow
{
    ... dynamically-allocated array that you can resize on-the-fly ....
};

That seems like an interesting solution. It does seems a bit contrived, so
for the moment, I'm using a dynamically allocated array, and (re)generate
the liststore when needed...

Thanks!
John



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