PlacesSidebar.connectPopulatePopup

Connect to PopulatePopup signal.

The places sidebar emits this signal when the user invokes a contextual popup on one of its items. In the signal handler, the application may add extra items to the menu as appropriate. For example, a file manager may want to add a "Properties" command to the menu.

It is not necessary to store the selected_item for each menu item; during their callbacks, the application can use gtk.places_sidebar.PlacesSidebar.getLocation to get the file to which the item refers.

The selected_item argument may be null in case the selection refers to a volume. In this case, selected_volume will be non-null. In this case, the calling application will have to gobject.object.ObjectWrap.ref_ the selected_volume and keep it around to use it in the callback.

The container and all its contents are destroyed after the user dismisses the popup. The popup is re-created (and thus, this signal is emitted) every time the user activates the contextual menu.

Before 3.18, the container always was a #GtkMenu, and you were expected to add your items as #GtkMenuItems. Since 3.18, the popup may be implemented as a #GtkPopover, in which case container will be something else, e.g. a #GtkBox, to which you may add #GtkModelButtons or other widgets, such as #GtkEntries, #GtkSpinButtons, etc. If your application can deal with this situation, you can set #GtkPlacesSidebar::populate-all to true to request that this signal is emitted for populating popovers as well.

class PlacesSidebar
gulong
connectPopulatePopup
(
T
)
(,
Flag!"After" after = No.After
)
if (
isCallable!T &&
is(ReturnType!T == void)
&&
(
Parameters!T.length < 1 ||
(
ParameterStorageClassTuple!T[0] == ParameterStorageClass.none &&
is(Parameters!T[0] : gtk.widget.Widget)
)
)
&&
(
Parameters!T.length < 2 ||
(
ParameterStorageClassTuple!T[1] == ParameterStorageClass.none &&
is(Parameters!T[1] : gio.file.File)
)
)
&&
(
Parameters!T.length < 3 ||
(
ParameterStorageClassTuple!T[2] == ParameterStorageClass.none &&
is(Parameters!T[2] : gio.volume.Volume)
)
)
&&
(
Parameters!T.length < 4 ||
(
ParameterStorageClassTuple!T[3] == ParameterStorageClass.none &&
)
)
&&
Parameters!T.length < 5
)

Parameters

callback T

signal callback delegate or function to connect

void callback(gtk.widget.Widget container, gio.file.File selectedItem, gio.volume.Volume selectedVolume, gtk.places_sidebar.PlacesSidebar placesSidebar)

container a #GtkMenu or another #GtkContainer (optional)

selectedItem #GFile with the item to which the popup should refer, or null in the case of a selected_volume. (optional)

selectedVolume #GVolume if the selected item is a volume, or null if it is a file. (optional)

placesSidebar the instance the signal is connected to (optional)

after Flag!"After"

Yes.After to execute callback after default handler, No.After to execute before (default)

Return Value

Type: gulong

Signal ID