PlacesSidebarRef

public struct PlacesSidebarRef : PlacesSidebarProtocol, GWeakCapturing

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 PlacesSidebarRef type acts as a lightweight Swift reference to an underlying GtkPlacesSidebar instance. It exposes methods that can operate on this data type through PlacesSidebarProtocol conformance. Use PlacesSidebarRef only as an unowned reference to an existing GtkPlacesSidebar instance.

  • ptr
    Untyped pointer to the underlying `GtkPlacesSidebar` instance.
    

    For type-safe access, use the generated, typed pointer places_sidebar_ptr property instead.

    Declaration

    Swift

    public let ptr: UnsafeMutableRawPointer!

PlacesSidebar Class

  • Designated initialiser from the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafeMutablePointer<GtkPlacesSidebar>)
  • Designated initialiser from a constant pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafePointer<GtkPlacesSidebar>)
  • Conditional initialiser from an optional pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafeMutablePointer<GtkPlacesSidebar>?)
  • Conditional initialiser from an optional, non-mutable pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafePointer<GtkPlacesSidebar>?)
  • Conditional initialiser from an optional gpointer

    Declaration

    Swift

    @inlinable
    init!(gpointer g: gpointer?)
  • Conditional initialiser from an optional, non-mutable gconstpointer

    Declaration

    Swift

    @inlinable
    init!(gconstpointer g: gconstpointer?)
  • Reference intialiser for a related type that implements PlacesSidebarProtocol

    Declaration

    Swift

    @inlinable
    init<T>(_ other: T) where T : PlacesSidebarProtocol
  • This factory is syntactic sugar for setting weak pointers wrapped in GWeak<T>

    Declaration

    Swift

    @inlinable
    static func unowned<T>(_ other: T) -> PlacesSidebarRef where T : PlacesSidebarProtocol
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to PlacesSidebarProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(cPointer: UnsafeMutablePointer<T>)
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to PlacesSidebarProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(constPointer: UnsafePointer<T>)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to PlacesSidebarProtocol.

    Declaration

    Swift

    @inlinable
    init(mutating raw: UnsafeRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to PlacesSidebarProtocol.

    Declaration

    Swift

    @inlinable
    init(raw: UnsafeMutableRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to PlacesSidebarProtocol.

    Declaration

    Swift

    @inlinable
    init(opaquePointer: OpaquePointer)
  • Creates a new `GtkPlacesSidebar` widget.
    

    The application should connect to at least the GtkPlacesSidebar::open-location signal to be notified when the user makes a selection in the sidebar.

    Declaration

    Swift

    @inlinable
    init()