如何获取gtk.ListStore的行数
How to get the number of rows of gtk.ListStore
如何在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的项目数/行数/长度/计数这是我的示例代码:
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);