Create a context menu in GtkNotebook

27784be5e0a3c40d432b2fa248eaa694.jpeg
1. create the
GtkNotebook
;
2. now just add new pages with
GtkNotebook::append_page($widget, $label)
;
3. the first parameter is the
GtkWidget
that will be the container of content;
4. the second one will be the
GtkWidget
of tab;
5. as you cannot get button release event on
GtkLabel
, create a
GtkEventBox
, and put
GtkLabel
inside;
6. add
GtkEventBox
as tab widget;
7. connect the
GtkEventBox
to
button-relesae-event
8. capture what button pressed, create
GtkMenu
and show it at event occur