StatusbarProtocol

public protocol StatusbarProtocol : WidgetProtocol

A GtkStatusbar widget is usually placed along the bottom of an application’s main [classGtk.Window].

An example GtkStatusbar

A GtkStatusBar may provide a regular commentary of the application’s status (as is usually the case in a web browser, for example), or may be used to simply output a message when the status changes, (when an upload is complete in an FTP client, for example).

Status bars in GTK maintain a stack of messages. The message at the top of the each bar’s stack is the one that will currently be displayed.

Any messages added to a statusbar’s stack must specify a context id that is used to uniquely identify the source of a message. This context id can be generated by [methodGtk.Statusbar.get_context_id], given a message and the statusbar that it will be added to. Note that messages are stored in a stack, and when choosing which message to display, the stack structure is adhered to, regardless of the context identifier of a message.

One could say that a statusbar maintains one stack of messages for display purposes, but allows multiple message producers to maintain sub-stacks of the messages they produced (via context ids).

Status bars are created using [ctorGtk.Statusbar.new].

Messages are added to the bar’s stack with [methodGtk.Statusbar.push].

The message at the top of the stack can be removed using [methodGtk.Statusbar.pop]. A message can be removed from anywhere in the stack if its message id was recorded at the time it was added. This is done using [methodGtk.Statusbar.remove].

CSS node

GtkStatusbar has a single CSS node with name statusbar.

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

  • ptr

    Untyped pointer to the underlying GtkStatusbar instance.

    Declaration

    Swift

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

    Typed pointer to the underlying GtkStatusbar instance.

    Default Implementation

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

    Declaration

    Swift

    var statusbar_ptr: UnsafeMutablePointer<GtkStatusbar>! { get }
  • Required Initialiser for types conforming to StatusbarProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

Statusbar Class

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

    Declaration

    Swift

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

    Declaration

    Swift

    @inlinable
    func get(property: StatusbarPropertyName) -> 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 Statusbar property. Note that this will only have an effect on properties that are writable and not construct-only!

    Declaration

    Swift

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

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

Statusbar signals

  • Connect a Swift signal handler to the given, typed StatusbarSignalName signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func connect(signal s: StatusbarSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> Int

    Parameters

    signal

    The signal to connect

    flags

    The connection flags to use

    data

    A pointer to user data to provide to the callback

    destroyData

    A GClosureNotify C function to destroy the data pointed to by userData

    handler

    The 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 a C signal handler to the given, typed StatusbarSignalName signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func connect(signal s: StatusbarSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> Int

    Parameters

    signal

    The signal to connect

    flags

    The connection flags to use

    data

    A pointer to user data to provide to the callback

    destroyData

    A GClosureNotify C function to destroy the data pointed to by userData

    signalHandler

    The C function to be called on the given signal

    Return Value

    The signal handler ID (always greater than 0 for successful connections)

  • onTextPopped(flags:handler:) Extension method

    Emitted whenever a new message is popped off a statusbar’s stack.

    Note

    This represents the underlying text-popped signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onTextPopped(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: StatusbarRef, _ contextId: UInt, _ text: String) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    contextId

    the context id of the relevant message/statusbar

    text

    the message that was just popped

    handler

    The signal handler to call Run the given callback whenever the textPopped signal is emitted

  • textPoppedSignal Extension method

    Typed text-popped signal for using the connect(signal:) methods

    Declaration

    Swift

    static var textPoppedSignal: StatusbarSignalName { get }
  • onTextPushed(flags:handler:) Extension method

    Emitted whenever a new message gets pushed onto a statusbar’s stack.

    Note

    This represents the underlying text-pushed signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onTextPushed(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: StatusbarRef, _ contextId: UInt, _ text: String) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    contextId

    the context id of the relevant message/statusbar

    text

    the message that was pushed

    handler

    The signal handler to call Run the given callback whenever the textPushed signal is emitted

  • textPushedSignal Extension method

    Typed text-pushed signal for using the connect(signal:) methods

    Declaration

    Swift

    static var textPushedSignal: StatusbarSignalName { get }

Statusbar Class: StatusbarProtocol extension (methods and fields)

  • Returns a new context identifier, given a description of the actual context.

    Note that the description is not shown in the UI.

    Declaration

    Swift

    @inlinable
    func getContextId(contextDescription: UnsafePointer<CChar>!) -> Int
  • pop(contextId:) Extension method

    Removes the first message in the GtkStatusbar’s stack with the given context id.

    Note that this may not change the displayed message, if the message at the top of the stack has a different context id.

    Declaration

    Swift

    @inlinable
    func pop(contextId: Int)
  • push(contextId:text:) Extension method

    Pushes a new message onto a statusbar’s stack.

    Declaration

    Swift

    @inlinable
    func push(contextId: Int, text: UnsafePointer<CChar>!) -> Int
  • remove(contextId:messageId:) Extension method

    Forces the removal of a message from a statusbar’s stack. The exact context_id and message_id must be specified.

    Declaration

    Swift

    @inlinable
    func remove(contextId: Int, messageId: Int)
  • removeAll(contextId:) Extension method

    Forces the removal of all messages from a statusbar’s stack with the exact context_id.

    Declaration

    Swift

    @inlinable
    func removeAll(contextId: Int)