1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| /* Static creation */
GtkTreeStore *store1 = gtk_tree_store_new( 2, G_TYPE_STRING, G_TYPE_INT );
/* Variable creation */
/* Create dynamic array 2 elements in size */
gsize array_size = sizeog( GType ) * 2;
GType *types = g_slice_alloc( array_size );
/* Assing types */
types[0] = G_TYPE_STRING;
types[1] = G_TYPE_INT;
/* Create store */
GtkTreeStore *store2 = gtk_tree_store_newv( 2, types );
/* Free array */
g_slice_free1( array_size, types ); |