package Messages_List is new Glib.GSlist.Generic_SList (Status_Bar_Msg);
package Implements_Buildable is new Glib.Types.Implements (Gtk.Buildable.Gtk_Buildable, Gtk_Status_Bar_Record, Gtk_Status_Bar);
package Implements_Orientable is new Glib.Types.Implements (Gtk.Orientable.Gtk_Orientable, Gtk_Status_Bar_Record, Gtk_Status_Bar);
type Gtk_Status_Bar_Record is new Gtk_Hbox_Record with null record;
type Gtk_Status_Bar is access all Gtk_Status_Bar_Record'Class;
type Context_Id is new Guint;
type Message_Id is new Guint;
type Status_Bar_Msg is record Text : Interfaces.C.Strings.chars_ptr; Context : Context_Id; Message : Message_Id; end record;
Has_Resize_Grip_Property : constant Glib.Properties.Property_Boolean;
Signal_Text_Popped : constant Glib.Signal_Name := "text-popped";
Signal_Text_Pushed : constant Glib.Signal_Name := "text-pushed";
function Convert
( | Msg | : System.Address) return Status_Bar_Msg; |
procedure Gtk_New
( | Statusbar | : out Gtk_Status_Bar); |
procedure Initialize
( | Statusbar | : access Gtk_Status_Bar_Record'Class); |
function Get_Type return Glib.GType;
function Get_Context_Id
( | Statusbar | : access Gtk_Status_Bar_Record; |
Context_Description | : UTF8_String) return Context_Id; |
function Get_Has_Resize_Grip
( | Statusbar | : access Gtk_Status_Bar_Record) return Boolean; |
procedure Set_Has_Resize_Grip
( | Statusbar | : access Gtk_Status_Bar_Record; |
Setting | : Boolean); |
function Get_Message_Area
( | Statusbar | : access Gtk_Status_Bar_Record) return Gtk.Widget.Gtk_Widget; |
procedure Pop
( | Statusbar | : access Gtk_Status_Bar_Record; |
Context | : Context_Id); |
function Push
( | Statusbar | : access Gtk_Status_Bar_Record; |
Context | : Context_Id; | |
Text | : UTF8_String) return Message_Id; |
procedure Remove
( | Statusbar | : access Gtk_Status_Bar_Record; |
Context | : Context_Id; | |
Message | : Message_Id); |
procedure Remove_All
( | Statusbar | : access Gtk_Status_Bar_Record; |
Context | : Context_Id); |
function Get_Messages
( | Statusbar | : access Gtk_Status_Bar_Record) return Gtk.Status_Bar.Messages_List.GSlist; |
function Get_Orientation
( | Self | : access Gtk_Status_Bar_Record) return Gtk.Enums.Gtk_Orientation; |
procedure Set_Orientation
( | Self | : access Gtk_Status_Bar_Record; |
Orientation | : Gtk.Enums.Gtk_Orientation); |
function "+"
( | Widget | : access Gtk_Status_Bar_Record'Class) return Gtk.Buildable.Gtk_Buildable renames Implements_Buildable.To_Interface; |
function "-"
( | Interf | : Gtk.Buildable.Gtk_Buildable) return Gtk_Status_Bar renames Implements_Buildable.To_Object; |
function "+"
( | Widget | : access Gtk_Status_Bar_Record'Class) return Gtk.Orientable.Gtk_Orientable renames Implements_Orientable.To_Interface; |
function "-"
( | Interf | : Gtk.Orientable.Gtk_Orientable) return Gtk_Status_Bar renames Implements_Orientable.To_Object; |
A status bar is a special widget in which you can display messages. This type of widget is generally found at the bottom of application windows, and is used to display help or error messages.
This widget works as a stack of messages, ie all older messages are kept when a new one is inserted. It is of course possible to remove the most recent message from the stack. This stack behavior is especially useful when messages can be displayed from several places in your application.
Thus, each one subprogram that needs to print a message can simply push it on the stack, and does not need to make sure that the user has had enough time to read the previous message (a timeout can be set to automatically remove the message after a specific delay) Each message is associated with a specific Context_Id. Each of this context can have a special name, and these context can be used to organize the messages into categories (for instance one for help messages and one for error messages). You can then selectively remove the most recent message of each category.