Adding row to the ListStore



Hi all,

I would like to aske you how I can insert row to the ListStore.

My code:
struct _DialogData
{
   GtkWindow * TreeView;
}

static GtkTreeModel * create_model()
{
   GtkListStore * store;
   GtkTreeIter iter;

store = gtk_list_store_new (4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);

   return GTK_TREE_MODEL(store);
}


int main(int argc, char *argv[])
{
   DialogData * data;
   data = g_new0(DialogData,1);
   GtkTreeModel * model;

   ......
   model = create_model();
   data->TreeView = gtk_tree_view_new_with_model(model);
   g_object_unref(model);
   // Now I want add data as a rows to the ListStore.
   // How I can do this
}

Thanks for your help.
Petr




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