I have a Gtk.Notebook that has a custom popup menu that is displayed when the user right clicks on any of the page buttons.
How can I know which notebook page the user clicked on? I want to add an action in my menu to make it the current page.
notebook.button_press_event.connect( (wid,evt) => {
if ( evt.button==3 ) {
// which page button did the user click on?
notebook.set_current_page( «clicked no tab» );
// ... make it the current page
}
}
I tried to find the tab by position:
int numtab = notebook.get_tab_at_pos((int)evt.x, (int)evt.y);
But there doesn't seem to be a get_tab_at_pos
or similar method.