populate_popup


Description:

[ Version ( since = "3.10" ) ]
public signal void populate_popup (Widget container, File? selected_item, Volume? selected_volume)

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 get_location 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 @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 Menu, and you were expected to add your items as MenuItems. Since 3.18, the popup may be implemented as a Popover, in which case container will be something else, e.g. a Box, to which you may add ModelButton s or other widgets, such as GtkEntriess, SpinButtons, 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.

Parameters:

container

a Menu or another Container

selected_item

File with the item to which the popup should refer, or null in the case of a selected_volume.

selected_volume

Volume if the selected item is a volume, or null if it is a file.