当前位置: 技术问答>linux和unix
GTK+ 中,遍历文件
来源: 互联网 发布时间:2016-05-26
本文导语: 用gtk_tree存放目录文件结构时时,怎样得到任一个 item 的全路径 | LZ说的是不是gtktreeview?如果是的话可以用一下方式选择: GtkWidget *treeview; treeview = glade_xml_get_widget(xml, "treeview3");//这句...
用gtk_tree存放目录文件结构时时,怎样得到任一个 item 的全路径
|
LZ说的是不是gtktreeview?如果是的话可以用一下方式选择:
GtkWidget *treeview;
treeview = glade_xml_get_widget(xml, "treeview3");//这句话是从Glade3生成的XML文件中导入treeview
g_assert(treeview != NULL);
GtkTreeSelection *selection;
GtkTreeModel *model;
GtkTreeIter iter;
selection = gtk_tree_view_get_selection( GTK_TREE_VIEW(treeview) );
g_assert(selection != NULL);
if (gtk_tree_selection_get_selected(selection, &model, &iter))
{……}
GtkWidget *treeview;
treeview = glade_xml_get_widget(xml, "treeview3");//这句话是从Glade3生成的XML文件中导入treeview
g_assert(treeview != NULL);
GtkTreeSelection *selection;
GtkTreeModel *model;
GtkTreeIter iter;
selection = gtk_tree_view_get_selection( GTK_TREE_VIEW(treeview) );
g_assert(selection != NULL);
if (gtk_tree_selection_get_selected(selection, &model, &iter))
{……}
|
up