Class Statusbar

All Implemented Interfaces:
PointerInterface

public class Statusbar extends Widget
A `GtkStatusbar` widget is usually placed along the bottom of an application's
main [class@Gtk.Window].

![An example GtkStatusbar](statusbar.png)

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 [method@Gtk.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 [ctor@Gtk.Statusbar.new].

Messages are added to the bar’s stack with [method@Gtk.Statusbar.push].

The message at the top of the stack can be removed using
[method@Gtk.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 [method@Gtk.Statusbar.remove].

## CSS node

`GtkStatusbar` has a single CSS node with name `statusbar`.

https://docs.gtk.org/gtk4/class.Statusbar.html

  • Field Details

  • Constructor Details

    • Statusbar

      public Statusbar(PointerContainer pointer)
    • Statusbar

      public Statusbar()
      Creates a new `GtkStatusbar` ready for messages.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getContextId

      public int getContextId(@Nonnull Str context_description)
      Returns a new context identifier, given a description
      of the actual context.

      Note that the description is not shown in the UI.
      Parameters:
      context_description - textual description of what context the new message is being used in
      Returns:
      an integer id
    • getContextId

      public int getContextId(String context_description)
      Returns a new context identifier, given a description
      of the actual context.

      Note that the description is not shown in the UI.
      Parameters:
      context_description - textual description of what context the new message is being used in
      Returns:
      an integer id
    • pop

      public void pop(int context_id)
      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.
      Parameters:
      context_id - a context identifier
    • push

      public int push(int context_id, @Nonnull Str text)
      Pushes a new message onto a statusbar’s stack.
      Parameters:
      context_id - the message’s context id, as returned by gtk_statusbar_get_context_id()
      text - the message to add to the statusbar
      Returns:
      a message id that can be used with [method@Gtk.Statusbar.remove].
    • push

      public int push(int context_id, String text)
      Pushes a new message onto a statusbar’s stack.
      Parameters:
      context_id - the message’s context id, as returned by gtk_statusbar_get_context_id()
      text - the message to add to the statusbar
      Returns:
      a message id that can be used with [method@Gtk.Statusbar.remove].
    • remove

      public void remove(int context_id, int message_id)
      Forces the removal of a message from a statusbar’s stack.
      The exact @context_id and @message_id must be specified.
      Parameters:
      context_id - a context identifier
      message_id - a message identifier, as returned by [method@Gtk.Statusbar.push]
    • removeAll

      public void removeAll(int context_id)
      Forces the removal of all messages from a statusbar's
      stack with the exact @context_id.
      Parameters:
      context_id - a context identifier
    • onTextPopped

      public SignalHandler onTextPopped(Statusbar.OnTextPopped signal)
      Connect to signal "text-popped".
      See Statusbar.OnTextPopped.onTextPopped(int, ch.bailu.gtk.type.Str) for signal description.
      Field SIGNAL_ON_TEXT_POPPED contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onTextPushed

      public SignalHandler onTextPushed(Statusbar.OnTextPushed signal)
      Connect to signal "text-pushed".
      See Statusbar.OnTextPushed.onTextPushed(int, ch.bailu.gtk.type.Str) for signal description.
      Field SIGNAL_ON_TEXT_PUSHED contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • asAccessible

      public Accessible asAccessible()
      Implements interface Accessible. Call this to get access to interface functions.
      Overrides:
      asAccessible in class Widget
      Returns:
      Accessible
    • asBuildable

      public Buildable asBuildable()
      Implements interface Buildable. Call this to get access to interface functions.
      Overrides:
      asBuildable in class Widget
      Returns:
      Buildable
    • asConstraintTarget

      public ConstraintTarget asConstraintTarget()
      Implements interface ConstraintTarget. Call this to get access to interface functions.
      Overrides:
      asConstraintTarget in class Widget
      Returns:
      ConstraintTarget
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()