Hi,
I need to show menu when right clicking at tree view with data(simple list_store filled with path to files).
I created Popover with Glade and later tried to use connect_button_press_event
function with tree view with data
tree_view.connect_button_press_event(move |tree_view, event| {
popover_right_click.show();
gtk::Inhibit(false)
});
But I have two problems:
- I don’t see any functions which would be able to set position of this popup(
event.get_position
returns(f64,f64)
),set_relative_to
takes as argument a widget, but I want to put popover exactly at the place where user clicked. - I don’t know how to see which element is clicked -
tree_view.get_selection()
will give info about all selected items(I use multiply selection feature) )instead lastly clicked element.
Also probably I will need to changeconnect_button_press_event
toconnect_button_release_event
because looks that selection/unselection happens after press event.