StatusbarProtocol
public protocol StatusbarProtocol : WidgetProtocol
A GtkStatusbar
widget is usually placed along the bottom of an application’s
main [classGtk.Window
].
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.
-
Untyped pointer to the underlying
GtkStatusbar
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
statusbar_ptr
Default implementationTyped 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)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) 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 transformationtransform_to
ValueTransformer
to use for backwards transformationReturn 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:
Extension methodvalue: ) 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
-
connect(signal:
Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
StatusbarSignalName
signalDeclaration
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 byuserData
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(signal:
Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
StatusbarSignalName
signalDeclaration
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 byuserData
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:
Extension methodhandler: ) Emitted whenever a new message is popped off a statusbar’s stack.
Note
This represents the underlyingtext-popped
signalDeclaration
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 methodTyped
text-popped
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var textPoppedSignal: StatusbarSignalName { get }
-
onTextPushed(flags:
Extension methodhandler: ) Emitted whenever a new message gets pushed onto a statusbar’s stack.
Note
This represents the underlyingtext-pushed
signalDeclaration
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 methodTyped
text-pushed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var textPushedSignal: StatusbarSignalName { get }
-
getContextId(contextDescription:
Extension method) 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:
Extension methodtext: ) Pushes a new message onto a statusbar’s stack.
Declaration
Swift
@inlinable func push(contextId: Int, text: UnsafePointer<CChar>!) -> Int
-
remove(contextId:
Extension methodmessageId: ) Forces the removal of a message from a statusbar’s stack. The exact
context_id
andmessage_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)