Gtk.TextView::populate-popup

function callback(text_view, popup:Gtk.Widget, ):void;

The ::populate-popup signal gets emitted before showing the context menu of the text view.

If you need to add items to the context menu, connect to this signal and append your items to the popup, which will be a Gtk.Menu in this case.

If Gtk.populate-all is true, this signal will also be emitted to populate touch popups. In this case, popup will be a different container, e.g. a Gtk.Toolbar.

The signal handler should not make assumptions about the type of @widget, but check whether popup is a Gtk.Menu or Gtk.Toolbar or another kind of container.

text_view

instance of Gtk.TextView that is emitting the signal

popup

the container that is being populated