There is a table with data in the ListStore model. The data is displayed by the TreeView component. When you hover over a line, it becomes highlighted. How to get access to the fields of this selected line? I tried to do this with the following C code snippet:
GtkTreeSelection *psel; GtkTreeIter iter; GValue value; char *pstr; gint num; // psel=gtk_tree_view_get_selection( (GtkTreeView*)(pTreeView) ); //ничего не выбрано num=gtk_tree_selection_count_selected_rows(psel); if ( num<1 ) return; // gtk_tree_selection_get_selected (psel,(GtkTreeModel**)(&pModel)),&iter); // //здесь появляются ошибки gtk_tree_model_get_value((GtkTreeModel*)(pModel) ,&iter,0,&value); pstr=(char*)g_value_get_string(&value); gtk_label_set_text(pLabel,pstr ); As I understand it, I'm doing something wrong. In theory, I should be able to access the selected fields through pTreeView, and not through the model. There may be no model at all. According to the documentation I can not understand anything. And I did not find anything on the Internet. But the task is trivial.