I have a GtkTreeView representing some data, and I want to have a GtkPopover appear on some action, pointing to that row. I have the popover working all but for the position.
How do you retrieve a widget for the currently selected row (or rows I suppose, but I will only deal with a selection of size == 1). I can get the models and the iterator, but I can't see how to get a row widget to pass into gtk_popover_set_relative_to
.
So far I have:
GtkTreeSelection *selection;
GtkTreeModel *model;
GtkTreeIter iter;
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
gtk_tree_selection_get_selected(selection, &model, &iter);
gtk_tree_model_get (model, &iter, ...);
GtkWidget *row; // need to fill this in
gtk_popover_set_relative_to (GTK_POPOVER (popover), GTK_WIDGET (row));
How can I fill in row
?
This question seems to sort-of meet the reverse (get row for position).