PlacesSidebarProtocol
public protocol PlacesSidebarProtocol : ScrolledWindowProtocol
GtkPlacesSidebar is a widget that displays a list of frequently-used places in the
file system: the user’s home directory, the user’s bookmarks, and volumes and drives.
This widget is used as a sidebar in GtkFileChooser and may be used by file managers
and similar programs.
The places sidebar displays drives and volumes, and will automatically mount or unmount them when the user selects them.
Applications can hook to various signals in the places sidebar to customize its behavior. For example, they can add extra commands to the context menu of the sidebar.
While bookmarks are completely in control of the user, the places sidebar also
allows individual applications to provide extra shortcut folders that are unique
to each application. For example, a Paint program may want to add a shortcut
for a Clipart folder. You can do this with gtk_places_sidebar_add_shortcut().
To make use of the places sidebar, an application at least needs to connect
to the GtkPlacesSidebar::open-location signal. This is emitted when the
user selects in the sidebar a location to open. The application should also
call gtk_places_sidebar_set_location() when it changes the currently-viewed
location.
CSS nodes
GtkPlacesSidebar uses a single CSS node with name placessidebar and style class .sidebar.
Among the children of the places sidebar, the following style classes can be used:
- .sidebar-new-bookmark-row for the ‘Add new bookmark’ row
- .sidebar-placeholder-row for a row that is a placeholder
- .has-open-popup when a popup is open for a row
The PlacesSidebarProtocol protocol exposes the methods and properties of an underlying GtkPlacesSidebar instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see PlacesSidebar.
Alternatively, use PlacesSidebarRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkPlacesSidebarinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
places_sidebar_ptrDefault implementationTyped pointer to the underlying
GtkPlacesSidebarinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkPlacesSidebarinstance.Declaration
Swift
var places_sidebar_ptr: UnsafeMutablePointer<GtkPlacesSidebar>! { get } -
Required Initialiser for types conforming to
PlacesSidebarProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
PlacesSidebarPropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: PlacesSidebarPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocolParameters
source_propertythe source property to bind
targetthe target object to bind to
target_propertythe target property to bind to
flagsthe flags to pass to the
Bindingtransform_fromValueTransformerto use for forward transformationtransform_toValueTransformerto use for backwards transformationReturn Value
binding reference or
nilin case of an error -
get(property:Extension method) Get the value of a PlacesSidebar property
Declaration
Swift
@inlinable func get(property: PlacesSidebarPropertyName) -> GLibObject.ValueParameters
propertythe property to get the value for
Return Value
the value of the named property
-
set(property:Extension methodvalue: ) Set the value of a PlacesSidebar property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: PlacesSidebarPropertyName, value v: GLibObject.Value)Parameters
propertythe property to get the value for
Return Value
the value of the named property
-
connect(signal:Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
PlacesSidebarSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: PlacesSidebarSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatahandlerThe Swift signal handler (function or callback) to invoke on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
connect(signal:Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
PlacesSidebarSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: PlacesSidebarSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatasignalHandlerThe C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
onDragActionAsk(flags:Extension methodhandler: ) The places sidebar emits this signal when it needs to ask the application to pop up a menu to ask the user for which drag action to perform.
Note
This represents the underlyingdrag-action-asksignalDeclaration
Swift
@discardableResult @inlinable func onDragActionAsk(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ actions: Int) -> Int) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
actionsPossible drag actions that need to be asked for.
handlerthe final drag action that the sidebar should pass to the drag side of the drag-and-drop operation. Run the given callback whenever the
dragActionAsksignal is emitted -
dragActionAskSignalExtension methodTyped
drag-action-asksignal for using theconnect(signal:)methodsDeclaration
Swift
static var dragActionAskSignal: PlacesSidebarSignalName { get } -
onDragActionRequested(flags:Extension methodhandler: ) When the user starts a drag-and-drop operation and the sidebar needs to ask the application for which drag action to perform, then the sidebar will emit this signal.
The application can evaluate the
contextfor customary actions, or it can check the type of the files indicated bysource_file_listagainst the possible actions for the destinationdest_file.The drag action to use must be the return value of the signal handler.
Note
This represents the underlyingdrag-action-requestedsignalDeclaration
Swift
@discardableResult @inlinable func onDragActionRequested(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ context: Gdk.DragContextRef, _ destFile: GIO.FileRef, _ sourceFileList: GLib.ListRef) -> Int) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
contextGdkDragContextwith information about the drag operationdestFileGFilewith the tentative location that is being hovered for a dropsourceFileListList of
GFilethat are being draggedhandlerThe drag action to use, for example,
GDK_ACTION_COPYorGDK_ACTION_MOVE, or 0 if no action is allowed here (i.e. drops are not allowed in the specifieddest_file). Run the given callback whenever thedragActionRequestedsignal is emitted -
dragActionRequestedSignalExtension methodTyped
drag-action-requestedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var dragActionRequestedSignal: PlacesSidebarSignalName { get } -
onDragPerformDrop(flags:Extension methodhandler: ) The places sidebar emits this signal when the user completes a drag-and-drop operation and one of the sidebar’s items is the destination. This item is in the
dest_file, and thesource_file_listhas the list of files that are dropped into it and which should be copied/moved/etc. based on the specifiedaction.Note
This represents the underlyingdrag-perform-dropsignalDeclaration
Swift
@discardableResult @inlinable func onDragPerformDrop(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ destFile: GIO.FileRef, _ sourceFileList: GLib.ListRef, _ action: Int) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
destFileDestination
GFile.sourceFileListGListofGFilethat got dropped.actionDrop action to perform.
handlerThe signal handler to call Run the given callback whenever the
dragPerformDropsignal is emitted -
dragPerformDropSignalExtension methodTyped
drag-perform-dropsignal for using theconnect(signal:)methodsDeclaration
Swift
static var dragPerformDropSignal: PlacesSidebarSignalName { get } -
onMount(flags:Extension methodhandler: ) The places sidebar emits this signal when it starts a new operation because the user clicked on some location that needs mounting. In this way the application using the
GtkPlacesSidebarcan track the progress of the operation and, for example, show a notification.Note
This represents the underlyingmountsignalDeclaration
Swift
@discardableResult @inlinable func onMount(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ mountOperation: GIO.MountOperationRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
mountOperationthe
GMountOperationthat is going to start.handlerThe signal handler to call Run the given callback whenever the
mountsignal is emitted -
mountSignalExtension methodTyped
mountsignal for using theconnect(signal:)methodsDeclaration
Swift
static var mountSignal: PlacesSidebarSignalName { get } -
onOpenLocation(flags:Extension methodhandler: ) The places sidebar emits this signal when the user selects a location in it. The calling application should display the contents of that location; for example, a file manager should show a list of files in the specified location.
Note
This represents the underlyingopen-locationsignalDeclaration
Swift
@discardableResult @inlinable func onOpenLocation(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ location: GIO.FileRef, _ openFlags: PlacesOpenFlags) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
locationGFileto which the caller should switch.openFlagsa single value from
GtkPlacesOpenFlagsspecifying how thelocationshould be opened.handlerThe signal handler to call Run the given callback whenever the
openLocationsignal is emitted -
openLocationSignalExtension methodTyped
open-locationsignal for using theconnect(signal:)methodsDeclaration
Swift
static var openLocationSignal: PlacesSidebarSignalName { get } -
onPopulatePopup(flags:Extension methodhandler: ) 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_itemfor each menu item; during their callbacks, the application can usegtk_places_sidebar_get_location()to get the file to which the item refers.The
selected_itemargument may benilin case the selection refers to a volume. In this case,selected_volumewill be non-nil. In this case, the calling application will have tog_object_ref()theselected_volumeand keep it around to use it in the callback.The
containerand 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
containeralways was aGtkMenu, and you were expected to add your items asGtkMenuItems. Since 3.18, the popup may be implemented as aGtkPopover, in which casecontainerwill be something else, e.g. aGtkBox, to which you may addGtkModelButtonsor other widgets, such asGtkEntries,GtkSpinButtons, etc. If your application can deal with this situation, you can setGtkPlacesSidebar::populate-alltotrueto request that this signal is emitted for populating popovers as well.Note
This represents the underlyingpopulate-popupsignalDeclaration
Swift
@discardableResult @inlinable func onPopulatePopup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ container: WidgetRef, _ selectedItem: GIO.FileRef?, _ selectedVolume: GIO.VolumeRef?) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
containera
GtkMenuor anotherGtkContainerselectedItemGFilewith the item to which the popup should refer, ornilin the case of aselected_volume.selectedVolumeGVolumeif the selected item is a volume, ornilif it is a file.handlerThe signal handler to call Run the given callback whenever the
populatePopupsignal is emitted -
populatePopupSignalExtension methodTyped
populate-popupsignal for using theconnect(signal:)methodsDeclaration
Swift
static var populatePopupSignal: PlacesSidebarSignalName { get } -
onShowConnectToServer(flags:Extension methodhandler: ) The places sidebar emits this signal when it needs the calling application to present an way to connect directly to a network server. For example, the application may bring up a dialog box asking for a URL like “sftp://ftp.example.com”. It is up to the application to create the corresponding mount by using, for example,
g_file_mount_enclosing_volume().Note
This represents the underlyingshow-connect-to-serversignalDeclaration
Swift
@discardableResult @inlinable func onShowConnectToServer(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
showConnectToServersignal is emitted -
showConnectToServerSignalExtension methodTyped
show-connect-to-serversignal for using theconnect(signal:)methodsDeclaration
Swift
static var showConnectToServerSignal: PlacesSidebarSignalName { get } -
onShowEnterLocation(flags:Extension methodhandler: ) The places sidebar emits this signal when it needs the calling application to present an way to directly enter a location. For example, the application may bring up a dialog box asking for a URL like “http://http.example.com”.
Note
This represents the underlyingshow-enter-locationsignalDeclaration
Swift
@discardableResult @inlinable func onShowEnterLocation(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
showEnterLocationsignal is emitted -
showEnterLocationSignalExtension methodTyped
show-enter-locationsignal for using theconnect(signal:)methodsDeclaration
Swift
static var showEnterLocationSignal: PlacesSidebarSignalName { get } -
onShowErrorMessage(flags:Extension methodhandler: ) The places sidebar emits this signal when it needs the calling application to present an error message. Most of these messages refer to mounting or unmounting media, for example, when a drive cannot be started for some reason.
Note
This represents the underlyingshow-error-messagesignalDeclaration
Swift
@discardableResult @inlinable func onShowErrorMessage(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ primary: String, _ secondary: String) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
primaryprimary message with a summary of the error to show.
secondarysecondary message with details of the error to show.
handlerThe signal handler to call Run the given callback whenever the
showErrorMessagesignal is emitted -
showErrorMessageSignalExtension methodTyped
show-error-messagesignal for using theconnect(signal:)methodsDeclaration
Swift
static var showErrorMessageSignal: PlacesSidebarSignalName { get } -
onShowOtherLocations(flags:Extension methodhandler: ) The places sidebar emits this signal when it needs the calling application to present a way to show other locations e.g. drives and network access points. For example, the application may bring up a page showing persistent volumes and discovered network addresses.
Note
This represents the underlyingshow-other-locationssignalDeclaration
Swift
@discardableResult @inlinable func onShowOtherLocations(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
showOtherLocationssignal is emitted -
showOtherLocationsSignalExtension methodTyped
show-other-locationssignal for using theconnect(signal:)methodsDeclaration
Swift
static var showOtherLocationsSignal: PlacesSidebarSignalName { get } -
onShowOtherLocationsWithFlags(flags:Extension methodhandler: ) The places sidebar emits this signal when it needs the calling application to present a way to show other locations e.g. drives and network access points. For example, the application may bring up a page showing persistent volumes and discovered network addresses.
Note
This represents the underlyingshow-other-locations-with-flagssignalDeclaration
Swift
@discardableResult @inlinable func onShowOtherLocationsWithFlags(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ openFlags: PlacesOpenFlags) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
openFlagsa single value from
GtkPlacesOpenFlagsspecifying how it should be opened.handlerThe signal handler to call Run the given callback whenever the
showOtherLocationsWithFlagssignal is emitted -
showOtherLocationsWithFlagsSignalExtension methodTyped
show-other-locations-with-flagssignal for using theconnect(signal:)methodsDeclaration
Swift
static var showOtherLocationsWithFlagsSignal: PlacesSidebarSignalName { get } -
onShowStarredLocation(flags:Extension methodhandler: ) The places sidebar emits this signal when it needs the calling application to present a way to show the starred files. In GNOME, starred files are implemented by setting the nao:predefined-tag-favorite tag in the tracker database.
Note
This represents the underlyingshow-starred-locationsignalDeclaration
Swift
@discardableResult @inlinable func onShowStarredLocation(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ openFlags: PlacesOpenFlags) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
openFlagsa single value from
GtkPlacesOpenFlagsspecifying how the starred file should be opened.handlerThe signal handler to call Run the given callback whenever the
showStarredLocationsignal is emitted -
showStarredLocationSignalExtension methodTyped
show-starred-locationsignal for using theconnect(signal:)methodsDeclaration
Swift
static var showStarredLocationSignal: PlacesSidebarSignalName { get } -
onUnmount(flags:Extension methodhandler: ) The places sidebar emits this signal when it starts a new operation because the user for example ejected some drive or unmounted a mount. In this way the application using the
GtkPlacesSidebarcan track the progress of the operation and, for example, show a notification.Note
This represents the underlyingunmountsignalDeclaration
Swift
@discardableResult @inlinable func onUnmount(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ mountOperation: GIO.MountOperationRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
mountOperationthe
GMountOperationthat is going to start.handlerThe signal handler to call Run the given callback whenever the
unmountsignal is emitted -
unmountSignalExtension methodTyped
unmountsignal for using theconnect(signal:)methodsDeclaration
Swift
static var unmountSignal: PlacesSidebarSignalName { get } -
onNotifyLocalOnly(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::local-onlysignalDeclaration
Swift
@discardableResult @inlinable func onNotifyLocalOnly(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyLocalOnlysignal is emitted -
notifyLocalOnlySignalExtension methodTyped
notify::local-onlysignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyLocalOnlySignal: PlacesSidebarSignalName { get } -
onNotifyLocation(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::locationsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyLocation(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyLocationsignal is emitted -
notifyLocationSignalExtension methodTyped
notify::locationsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyLocationSignal: PlacesSidebarSignalName { get } -
onNotifyOpenFlags(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::open-flagssignalDeclaration
Swift
@discardableResult @inlinable func onNotifyOpenFlags(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyOpenFlagssignal is emitted -
notifyOpenFlagsSignalExtension methodTyped
notify::open-flagssignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyOpenFlagsSignal: PlacesSidebarSignalName { get } -
onNotifyPopulateAll(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::populate-allsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyPopulateAll(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyPopulateAllsignal is emitted -
notifyPopulateAllSignalExtension methodTyped
notify::populate-allsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyPopulateAllSignal: PlacesSidebarSignalName { get } -
onNotifyShowConnectToServer(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::show-connect-to-serversignalDeclaration
Swift
@discardableResult @inlinable func onNotifyShowConnectToServer(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyShowConnectToServersignal is emitted -
notifyShowConnectToServerSignalExtension methodTyped
notify::show-connect-to-serversignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyShowConnectToServerSignal: PlacesSidebarSignalName { get } -
onNotifyShowDesktop(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::show-desktopsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyShowDesktop(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyShowDesktopsignal is emitted -
notifyShowDesktopSignalExtension methodTyped
notify::show-desktopsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyShowDesktopSignal: PlacesSidebarSignalName { get } -
onNotifyShowEnterLocation(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::show-enter-locationsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyShowEnterLocation(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyShowEnterLocationsignal is emitted -
notifyShowEnterLocationSignalExtension methodTyped
notify::show-enter-locationsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyShowEnterLocationSignal: PlacesSidebarSignalName { get } -
onNotifyShowOtherLocations(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::show-other-locationssignalDeclaration
Swift
@discardableResult @inlinable func onNotifyShowOtherLocations(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyShowOtherLocationssignal is emitted -
notifyShowOtherLocationsSignalExtension methodTyped
notify::show-other-locationssignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyShowOtherLocationsSignal: PlacesSidebarSignalName { get } -
onNotifyShowRecent(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::show-recentsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyShowRecent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyShowRecentsignal is emitted -
notifyShowRecentSignalExtension methodTyped
notify::show-recentsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyShowRecentSignal: PlacesSidebarSignalName { get } -
onNotifyShowStarredLocation(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::show-starred-locationsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyShowStarredLocation(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyShowStarredLocationsignal is emitted -
notifyShowStarredLocationSignalExtension methodTyped
notify::show-starred-locationsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyShowStarredLocationSignal: PlacesSidebarSignalName { get } -
onNotifyShowTrash(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::show-trashsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyShowTrash(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyShowTrashsignal is emitted -
notifyShowTrashSignalExtension methodTyped
notify::show-trashsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyShowTrashSignal: PlacesSidebarSignalName { get }
-
addShortcut(location:Extension method) Applications may want to present some folders in the places sidebar if they could be immediately useful to users. For example, a drawing program could add a “/usr/share/clipart” location when the sidebar is being used in an “Insert Clipart” dialog box.
This function adds the specified
locationto a special place for immutable shortcuts. The shortcuts are application-specific; they are not shared across applications, and they are not persistent. If this function is called multiple times with different locations, then they are added to the sidebar’s list in the same order as the function is called.Declaration
Swift
@inlinable func addShortcut<FileT>(location: FileT) where FileT : FileProtocol -
getLocalOnly()Extension methodReturns the value previously set with
gtk_places_sidebar_set_local_only().Declaration
Swift
@inlinable func getLocalOnly() -> Bool -
getLocation()Extension methodGets the currently selected location in the
sidebar. This can benilwhen nothing is selected, for example, whengtk_places_sidebar_set_location()has been called with a location that is not among the sidebar’s list of places to show.You can use this function to get the selection in the
sidebar. Also, if you connect to theGtkPlacesSidebar::populate-popupsignal, you can use this function to get the location that is being referred to during the callbacks for your menu items.Declaration
Swift
@inlinable func getLocation() -> GIO.FileRef! -
getNthBookmark(n:Extension method) This function queries the bookmarks added by the user to the places sidebar, and returns one of them. This function is used by
GtkFileChooserto implement the “Alt-1”, “Alt-2”, etc. shortcuts, which activate the cooresponding bookmark.Declaration
Swift
@inlinable func getNthBookmark(n: Int) -> GIO.FileRef! -
getOpenFlags()Extension methodGets the open flags.
Declaration
Swift
@inlinable func getOpenFlags() -> PlacesOpenFlags -
getShowConnectToServer()Extension methodReturns the value previously set with
gtk_places_sidebar_set_show_connect_to_server()get_show_connect_to_server is deprecated: It is recommended to group this functionality with the drives and network location under the new ‘Other Location’ item
Declaration
Swift
@available(*, deprecated) @inlinable func getShowConnectToServer() -> Bool -
getShowDesktop()Extension methodReturns the value previously set with
gtk_places_sidebar_set_show_desktop()Declaration
Swift
@inlinable func getShowDesktop() -> Bool -
getShowEnterLocation()Extension methodReturns the value previously set with
gtk_places_sidebar_set_show_enter_location()Declaration
Swift
@inlinable func getShowEnterLocation() -> Bool -
getShowOtherLocations()Extension methodReturns the value previously set with
gtk_places_sidebar_set_show_other_locations()Declaration
Swift
@inlinable func getShowOtherLocations() -> Bool -
getShowRecent()Extension methodReturns the value previously set with
gtk_places_sidebar_set_show_recent()Declaration
Swift
@inlinable func getShowRecent() -> Bool -
getShowStarredLocation()Extension methodReturns the value previously set with
gtk_places_sidebar_set_show_starred_location()Declaration
Swift
@inlinable func getShowStarredLocation() -> Bool -
getShowTrash()Extension methodReturns the value previously set with
gtk_places_sidebar_set_show_trash()Declaration
Swift
@inlinable func getShowTrash() -> Bool -
listShortcuts()Extension methodGets the list of shortcuts.
Declaration
Swift
@inlinable func listShortcuts() -> GLib.SListRef! -
removeShortcut(location:Extension method) Removes an application-specific shortcut that has been previously been inserted with
gtk_places_sidebar_add_shortcut(). If thelocationis not a shortcut in the sidebar, then nothing is done.Declaration
Swift
@inlinable func removeShortcut<FileT>(location: FileT) where FileT : FileProtocol -
setDropTargets(visible:Extension methodcontext: ) Make the GtkPlacesSidebar show drop targets, so it can show the available drop targets and a “new bookmark” row. This improves the Drag-and-Drop experience of the user and allows applications to show all available drop targets at once.
This needs to be called when the application is aware of an ongoing drag that might target the sidebar. The drop-targets-visible state will be unset automatically if the drag finishes in the GtkPlacesSidebar. You only need to unset the state when the drag ends on some other widget on your application.
Declaration
Swift
@inlinable func setDropTargets<DragContextT>(visible: Bool, context: DragContextT) where DragContextT : DragContextProtocol -
set(localOnly:Extension method) Sets whether the
sidebarshould only show local files.Declaration
Swift
@inlinable func set(localOnly: Bool) -
set(location:Extension method) Sets the location that is being shown in the widgets surrounding the
sidebar, for example, in a folder view in a file manager. In turn, thesidebarwill highlight that location if it is being shown in the list of places, or it will unhighlight everything if thelocationis not among the places in the list.Declaration
Swift
@inlinable func set(location: GIO.FileRef? = nil) -
set(location:Extension method) Sets the location that is being shown in the widgets surrounding the
sidebar, for example, in a folder view in a file manager. In turn, thesidebarwill highlight that location if it is being shown in the list of places, or it will unhighlight everything if thelocationis not among the places in the list.Declaration
Swift
@inlinable func set<FileT>(location: FileT?) where FileT : FileProtocol -
setOpen(flags:Extension method) Sets the way in which the calling application can open new locations from the places sidebar. For example, some applications only open locations “directly” into their main view, while others may support opening locations in a new notebook tab or a new window.
This function is used to tell the places
sidebarabout the ways in which the application can open new locations, so that the sidebar can display (or not) the “Open in new tab” and “Open in new window” menu items as appropriate.When the
GtkPlacesSidebar::open-locationsignal is emitted, its flags argument will be set to one of theflagsthat was passed ingtk_places_sidebar_set_open_flags().Passing 0 for
flagswill causeGTK_PLACES_OPEN_NORMALto always be sent to callbacks for the “open-location” signal.Declaration
Swift
@inlinable func setOpen(flags: PlacesOpenFlags) -
set(showConnectToServer:Extension method) Sets whether the
sidebarshould show an item for connecting to a network server; this is off by default. An application may want to turn this on if it implements a way for the user to connect to network servers directly.If you enable this, you should connect to the
GtkPlacesSidebar::show-connect-to-serversignal.set_show_connect_to_server is deprecated: It is recommended to group this functionality with the drives and network location under the new ‘Other Location’ item
Declaration
Swift
@available(*, deprecated) @inlinable func set(showConnectToServer: Bool) -
set(showDesktop:Extension method) Sets whether the
sidebarshould show an item for the Desktop folder. The default value for this option is determined by the desktop environment and the user’s configuration, but this function can be used to override it on a per-application basis.Declaration
Swift
@inlinable func set(showDesktop: Bool) -
set(showEnterLocation:Extension method) Sets whether the
sidebarshould show an item for entering a location; this is off by default. An application may want to turn this on if manually entering URLs is an expected user action.If you enable this, you should connect to the
GtkPlacesSidebar::show-enter-locationsignal.Declaration
Swift
@inlinable func set(showEnterLocation: Bool) -
set(showOtherLocations:Extension method) Sets whether the
sidebarshould show an item for the application to show an Other Locations view; this is off by default. When set totrue, persistent devices such as hard drives are hidden, otherwise they are shown in the sidebar. An application may want to turn this on if it implements a way for the user to see and interact with drives and network servers directly.If you enable this, you should connect to the
GtkPlacesSidebar::show-other-locationssignal.Declaration
Swift
@inlinable func set(showOtherLocations: Bool) -
set(showRecent:Extension method) Sets whether the
sidebarshould show an item for recent files. The default value for this option is determined by the desktop environment, but this function can be used to override it on a per-application basis.Declaration
Swift
@inlinable func set(showRecent: Bool) -
set(showStarredLocation:Extension method) If you enable this, you should connect to the
GtkPlacesSidebar::show-starred-locationsignal.Declaration
Swift
@inlinable func set(showStarredLocation: Bool) -
set(showTrash:Extension method) Sets whether the
sidebarshould show an item for the Trash location.Declaration
Swift
@inlinable func set(showTrash: Bool) -
localOnlyExtension methodReturns the value previously set with
gtk_places_sidebar_set_local_only().Declaration
Swift
@inlinable var localOnly: Bool { get nonmutating set } -
locationExtension methodUndocumented
Declaration
Swift
@inlinable var location: GIO.FileRef! { get nonmutating set } -
openFlagsExtension methodGets the open flags.
Declaration
Swift
@inlinable var openFlags: PlacesOpenFlags { get nonmutating set } -
showConnectToServerExtension methodReturns the value previously set with
gtk_places_sidebar_set_show_connect_to_server()get_show_connect_to_server is deprecated: It is recommended to group this functionality with the drives and network location under the new ‘Other Location’ item
Declaration
Swift
@inlinable var showConnectToServer: Bool { get nonmutating set } -
showDesktopExtension methodReturns the value previously set with
gtk_places_sidebar_set_show_desktop()Declaration
Swift
@inlinable var showDesktop: Bool { get nonmutating set } -
showEnterLocationExtension methodReturns the value previously set with
gtk_places_sidebar_set_show_enter_location()Declaration
Swift
@inlinable var showEnterLocation: Bool { get nonmutating set } -
showOtherLocationsExtension methodReturns the value previously set with
gtk_places_sidebar_set_show_other_locations()Declaration
Swift
@inlinable var showOtherLocations: Bool { get nonmutating set } -
showRecentExtension methodReturns the value previously set with
gtk_places_sidebar_set_show_recent()Declaration
Swift
@inlinable var showRecent: Bool { get nonmutating set } -
showStarredLocationExtension methodReturns the value previously set with
gtk_places_sidebar_set_show_starred_location()Declaration
Swift
@inlinable var showStarredLocation: Bool { get nonmutating set } -
showTrashExtension methodReturns the value previously set with
gtk_places_sidebar_set_show_trash()Declaration
Swift
@inlinable var showTrash: Bool { get nonmutating set }
View on GitHub
Install in Dash
PlacesSidebarProtocol Protocol Reference