HeaderBarProtocol

public protocol HeaderBarProtocol : ContainerProtocol

GtkHeaderBar is similar to a horizontal GtkBox. It allows children to be placed at the start or the end. In addition, it allows a title and subtitle to be displayed. The title will be centered with respect to the width of the box, even if the children at either side take up different amounts of space. The height of the titlebar will be set to provide sufficient space for the subtitle, even if none is currently set. If a subtitle is not needed, the space reservation can be turned off with gtk_header_bar_set_has_subtitle().

GtkHeaderBar can add typical window frame controls, such as minimize, maximize and close buttons, or the window icon.

For these reasons, GtkHeaderBar is the natural choice for use as the custom titlebar widget of a GtkWindow (see gtk_window_set_titlebar()), as it gives features typical of titlebars while allowing the addition of child widgets.

The HeaderBarProtocol protocol exposes the methods and properties of an underlying GtkHeaderBar 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 HeaderBar. Alternatively, use HeaderBarRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying GtkHeaderBar instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • header_bar_ptr Default implementation

    Typed pointer to the underlying GtkHeaderBar instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the GtkHeaderBar instance.

    Declaration

    Swift

    var header_bar_ptr: UnsafeMutablePointer<GtkHeaderBar>! { get }
  • Required Initialiser for types conforming to HeaderBarProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

HeaderBar Class

  • Bind a HeaderBarPropertyName source property to a given target object.

    Declaration

    Swift

    @discardableResult
    @inlinable
    func bind<Q, T>(property source_property: HeaderBarPropertyName, 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 : ObjectProtocol

    Parameters

    source_property

    the source property to bind

    target

    the target object to bind to

    target_property

    the target property to bind to

    flags

    the flags to pass to the Binding

    transform_from

    ValueTransformer to use for forward transformation

    transform_to

    ValueTransformer to use for backwards transformation

    Return Value

    binding reference or nil in case of an error

  • get(property:) Extension method

    Get the value of a HeaderBar property

    Declaration

    Swift

    @inlinable
    func get(property: HeaderBarPropertyName) -> GLibObject.Value

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

  • set(property:value:) Extension method

    Set the value of a HeaderBar property. Note that this will only have an effect on properties that are writable and not construct-only!

    Declaration

    Swift

    @inlinable
    func set(property: HeaderBarPropertyName, value v: GLibObject.Value)

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

HeaderBar Class: HeaderBarProtocol extension (methods and fields)

  • getCustomTitle() Extension method

    Retrieves the custom title widget of the header. See gtk_header_bar_set_custom_title().

    Declaration

    Swift

    @inlinable
    func getCustomTitle() -> WidgetRef!
  • getDecorationLayout() Extension method

    Gets the decoration layout set with gtk_header_bar_set_decoration_layout().

    Declaration

    Swift

    @inlinable
    func getDecorationLayout() -> String!
  • getHasSubtitle() Extension method

    Retrieves whether the header bar reserves space for a subtitle, regardless if one is currently set or not.

    Declaration

    Swift

    @inlinable
    func getHasSubtitle() -> Bool
  • getShowCloseButton() Extension method

    Returns whether this header bar shows the standard window decorations.

    Declaration

    Swift

    @inlinable
    func getShowCloseButton() -> Bool
  • getSubtitle() Extension method

    Retrieves the subtitle of the header. See gtk_header_bar_set_subtitle().

    Declaration

    Swift

    @inlinable
    func getSubtitle() -> String!
  • getTitle() Extension method

    Retrieves the title of the header. See gtk_header_bar_set_title().

    Declaration

    Swift

    @inlinable
    func getTitle() -> String!
  • packEnd(child:) Extension method

    Adds child to bar, packed with reference to the end of the bar.

    Declaration

    Swift

    @inlinable
    func packEnd<WidgetT>(child: WidgetT) where WidgetT : WidgetProtocol
  • packStart(child:) Extension method

    Adds child to bar, packed with reference to the start of the bar.

    Declaration

    Swift

    @inlinable
    func packStart<WidgetT>(child: WidgetT) where WidgetT : WidgetProtocol
  • setCustomTitle(titleWidget:) Extension method

    Sets a custom title for the GtkHeaderBar.

    The title should help a user identify the current view. This supersedes any title set by gtk_header_bar_set_title() or gtk_header_bar_set_subtitle(). To achieve the same style as the builtin title and subtitle, use the “title” and “subtitle” style classes.

    You should set the custom title to nil, for the header title label to be visible again.

    Declaration

    Swift

    @inlinable
    func setCustomTitle(titleWidget: WidgetRef? = nil)
  • setCustomTitle(titleWidget:) Extension method

    Sets a custom title for the GtkHeaderBar.

    The title should help a user identify the current view. This supersedes any title set by gtk_header_bar_set_title() or gtk_header_bar_set_subtitle(). To achieve the same style as the builtin title and subtitle, use the “title” and “subtitle” style classes.

    You should set the custom title to nil, for the header title label to be visible again.

    Declaration

    Swift

    @inlinable
    func setCustomTitle<WidgetT>(titleWidget: WidgetT?) where WidgetT : WidgetProtocol
  • setDecoration(layout:) Extension method

    Sets the decoration layout for this header bar, overriding the GtkSettings:gtk-decoration-layout setting.

    There can be valid reasons for overriding the setting, such as a header bar design that does not allow for buttons to take room on the right, or only offers room for a single close button. Split header bars are another example for overriding the setting.

    The format of the string is button names, separated by commas. A colon separates the buttons that should appear on the left from those on the right. Recognized button names are minimize, maximize, close, icon (the window icon) and menu (a menu button for the fallback app menu).

    For example, “menu:minimize,maximize,close” specifies a menu on the left, and minimize, maximize and close buttons on the right.

    Declaration

    Swift

    @inlinable
    func setDecoration(layout: UnsafePointer<gchar>? = nil)
  • setHasSubtitle(setting:) Extension method

    Sets whether the header bar should reserve space for a subtitle, even if none is currently set.

    Declaration

    Swift

    @inlinable
    func setHasSubtitle(setting: Bool)
  • setShowCloseButton(setting:) Extension method

    Sets whether this header bar shows the standard window decorations, including close, maximize, and minimize.

    Declaration

    Swift

    @inlinable
    func setShowCloseButton(setting: Bool)
  • set(subtitle:) Extension method

    Sets the subtitle of the GtkHeaderBar. The title should give a user an additional detail to help him identify the current view.

    Note that GtkHeaderBar by default reserves room for the subtitle, even if none is currently set. If this is not desired, set the GtkHeaderBar:has-subtitle property to false.

    Declaration

    Swift

    @inlinable
    func set(subtitle: UnsafePointer<gchar>? = nil)
  • set(title:) Extension method

    Sets the title of the GtkHeaderBar. The title should help a user identify the current view. A good title should not include the application name.

    Declaration

    Swift

    @inlinable
    func set(title: UnsafePointer<gchar>? = nil)
  • customTitle Extension method

    Retrieves the custom title widget of the header. See gtk_header_bar_set_custom_title().

    Declaration

    Swift

    @inlinable
    var customTitle: WidgetRef! { get nonmutating set }
  • decorationLayout Extension method

    Gets the decoration layout set with gtk_header_bar_set_decoration_layout().

    Declaration

    Swift

    @inlinable
    var decorationLayout: String! { get nonmutating set }
  • hasSubtitle Extension method

    Retrieves whether the header bar reserves space for a subtitle, regardless if one is currently set or not.

    Declaration

    Swift

    @inlinable
    var hasSubtitle: Bool { get nonmutating set }
  • showCloseButton Extension method

    Returns whether this header bar shows the standard window decorations.

    Declaration

    Swift

    @inlinable
    var showCloseButton: Bool { get nonmutating set }
  • subtitle Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var subtitle: String! { get nonmutating set }
  • title Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var title: String! { get nonmutating set }
  • container Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var container: GtkContainer { get }