A Gtk.Status_Bar.Gtk_Status_Bar is usually placed along the bottom of an application's main Gtk.Window.Gtk_Window. It 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 Gtk.Status_Bar.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 Gtk.Status_Bar.Gtk_New.
Messages are added to the bar's stack with Gtk.Status_Bar.Push.
The message at the top of the stack can be removed using Gtk.Status_Bar.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 Gtk.Status_Bar.Remove.
# CSS node
GtkStatusbar has a single CSS node with name statusbar.
<screenshot>gtk-status_bar</screenshot> <group>Display widgets</group> <testgtk>create_status.adb</testgtk>
function "+"
(Widget : access Gtk_Status_Bar_Record'Class)
return Gtk.Buildable.Gtk_Buildable
function "+"
(Widget : access Gtk_Status_Bar_Record'Class)
return Gtk.Orientable.Gtk_Orientable
function "-"
(Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Status_Bar
function "-"
(Interf : Gtk.Orientable.Gtk_Orientable)
return Gtk_Status_Bar
type Cb_GObject_Context_Id_UTF8_String_Void is not null access procedure
(Self : access Glib.Object.GObject_Record'Class;
Context : Context_Id;
Text : UTF8_String);
type Cb_Gtk_Status_Bar_Context_Id_UTF8_String_Void is not null access procedure
(Self : access Gtk_Status_Bar_Record'Class;
Context : Context_Id;
Text : UTF8_String);
type Context_Id is new Guint;
function Get_Context_Id
(Statusbar : not null access Gtk_Status_Bar_Record;
Context_Description : UTF8_String) return Context_Id
Returns a new context identifier, given a description of the actual context. Note that the description is not shown in the UI.
textual description of what context the new message is being used in
function Get_Message_Area
(Statusbar : not null access Gtk_Status_Bar_Record)
return Gtk.Widget.Gtk_Widget
Retrieves the box containing the label widget. Since: gtk+ 2.20
a Gtk.Box.Gtk_Box
function Get_Orientation
(Self : not null access Gtk_Status_Bar_Record)
return Gtk.Enums.Gtk_Orientation
function Get_Type return Glib.GType
procedure Gtk_New (Statusbar : out Gtk_Status_Bar)
Creates a new Gtk.Status_Bar.Gtk_Status_Bar ready for messages. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
type Gtk_Status_Bar is access all Gtk_Status_Bar_Record'Class;
function Gtk_Status_Bar_New return Gtk_Status_Bar
Creates a new Gtk.Status_Bar.Gtk_Status_Bar ready for messages.
type Gtk_Status_Bar_Record is new Gtk_Box_Record with null record;
package Implements_Gtk_Buildable is new Glib.Types.Implements
(Gtk.Buildable.Gtk_Buildable, Gtk_Status_Bar_Record, Gtk_Status_Bar);
package Implements_Gtk_Orientable is new Glib.Types.Implements
(Gtk.Orientable.Gtk_Orientable, Gtk_Status_Bar_Record, Gtk_Status_Bar);
procedure Initialize
(Statusbar : not null access Gtk_Status_Bar_Record'Class)
Creates a new Gtk.Status_Bar.Gtk_Status_Bar ready for messages. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
type Message_Id is new Guint;
procedure On_Text_Popped
(Self : not null access Gtk_Status_Bar_Record;
Call : Cb_GObject_Context_Id_UTF8_String_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False)
Is emitted whenever a new message is popped off a statusbar's stack.
Callback parameters: -- @param Context the context id of the relevant message/statusbar -- @param Text the message that was just popped
procedure On_Text_Popped
(Self : not null access Gtk_Status_Bar_Record;
Call : Cb_Gtk_Status_Bar_Context_Id_UTF8_String_Void;
After : Boolean := False)
Is emitted whenever a new message is popped off a statusbar's stack.
Callback parameters: -- @param Context the context id of the relevant message/statusbar -- @param Text the message that was just popped
procedure On_Text_Pushed
(Self : not null access Gtk_Status_Bar_Record;
Call : Cb_GObject_Context_Id_UTF8_String_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False)
Is emitted whenever a new message gets pushed onto a statusbar's stack.
Callback parameters: -- @param Context the context id of the relevant message/statusbar -- @param Text the message that was pushed
procedure On_Text_Pushed
(Self : not null access Gtk_Status_Bar_Record;
Call : Cb_Gtk_Status_Bar_Context_Id_UTF8_String_Void;
After : Boolean := False)
Is emitted whenever a new message gets pushed onto a statusbar's stack.
Callback parameters: -- @param Context the context id of the relevant message/statusbar -- @param Text the message that was pushed
procedure Pop
(Statusbar : not null access Gtk_Status_Bar_Record;
Context : Context_Id)
Removes the first message in the Gtk.Status_Bar.Gtk_Status_Bar'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.
a context identifier
function Push
(Statusbar : not null access Gtk_Status_Bar_Record;
Context : Context_Id;
Text : UTF8_String) return Message_Id
Pushes a new message onto a statusbar's stack.
the message's context id, as returned by Gtk.Status_Bar.Get_Context_Id
the message to add to the statusbar
procedure Remove
(Statusbar : not null access Gtk_Status_Bar_Record;
Context : Context_Id;
Message : Message_Id)
Forces the removal of a message from a statusbar's stack. The exact Context_Id and Message_Id must be specified.
a context identifier
a message identifier, as returned by Gtk.Status_Bar.Push
procedure Remove_All
(Statusbar : not null access Gtk_Status_Bar_Record;
Context : Context_Id)
Forces the removal of all messages from a statusbar's stack with the exact Context_Id. Since: gtk+ 2.22
a context identifier
procedure Set_Orientation
(Self : not null access Gtk_Status_Bar_Record;
Orientation : Gtk.Enums.Gtk_Orientation)
Signal_Text_Popped : constant Glib.Signal_Name := "text-popped";
Is emitted whenever a new message is popped off a statusbar's stack.
Callback parameters: -- @param Context the context id of the relevant message/statusbar -- @param Text the message that was just popped
Signal_Text_Pushed : constant Glib.Signal_Name := "text-pushed";
Is emitted whenever a new message gets pushed onto a statusbar's stack.
Callback parameters: -- @param Context the context id of the relevant message/statusbar -- @param Text the message that was pushed