如何在C中获取gtk.ListStore的项目数/行数/长度/计数
这是我的示例代码:
store = gtk_list_store_new (NUM_COLS, G_TYPE_STRING, G_TYPE_UINT);
/* Append a row and fill in some data */
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
COL_NAME, "Heinz El-Mann",
COL_AGE, 51,
-1);
/* .
.
.
*/
/* get the length of gtk_list_store*/
最佳答案
使用gtk_tree_model_iter_n_children 获取列表存储中的行数。
在你的情况下
number_of_rows = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), NULL);
关于c - 如何获取 gtk.ListStore 的行数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39702800/