9.8 Statusbars
Statusbars are simple widgets used to display a text message. They keep a stack of the messages pushed onto them, so that popping the current message will re-display the previous text message.
In order to allow different parts of an application to use the same statusbar to display messages, the statusbar widget issues Context Identifiers which are used to identify different "users". The message on top of the stack is the one displayed, no matter what context it is in. Messages are stacked in last-in-first-out order, not context identifier order.
A statusbar is created with a call to:
|
A new Context Identifier is requested using a call to the following function with a short textual description of the context:
|
There are three functions that can operate on statusbars:
|
The first, gtk_statusbar_push, is used to add a new message to the statusbar. It returns a Message Identifier, which can be passed later to the function gtk_statusbar_remove to remove the message with the given Message and Context Identifiers from the statusbar's stack.
The function gtk_statusbar_pop removes the message highest in the stack with the given Context Identifier.
The following example creates a statusbar and two buttons, one for pushing items onto the statusbar, and one for popping the last item back off.
|
9.9 Text Entries
The Entry widget allows text to be typed and displayed in a single line text box. The text may be set with function calls that allow new text to replace, prepend or append the current contents of the Entry widget.
There are two functions for creating Entry widgets:
|
The first just creates a new Entry widget, whilst the second creates a new Entry and sets a limit on the length of the text within the Entry.
There are several functions for altering the text which is currently within the Entry widget.