Gtk.Menu.prototype.attach_to_widget

function attach_to_widget(attach_widget:Gtk.Widget, detacher:Gtk.MenuDetachFunc):void {
    // Gjs wrapper for gtk_menu_attach_to_widget()
}

Attaches the menu to the widget and provides a callback function that will be invoked when the menu calls Gtk.detach during its destruction.

attach_widget

the Gtk.Widget that the menu will be attached to

detacher

the user supplied callback function that will be called when the menu calls Gtk.detach