Whole document tree
    

Whole document tree

Using GnomeAppBar directly

9.2. Using GnomeAppBar directly

9.2.2. Using a GnomeAppBar to display status

The appbar displays one message at a time. There are three kinds of messages: transient status messages, messages on the stack, and the default message.

It is possible and even encouraged to use only one of the three kinds of message. You can make the appbar as simple or as complicated as you like; with only gnome_appbar_set_status(), it's basically just a GtkLabel.

Often you want to pop up a message that isn't very important, and you don't want to worry about removing it later. gnome_appbar_set_status() does this for you. It sets the message in the appbar until the next time the appbar is changed.

If you want, you can use the appbar with only this function. For simple applications it can be a nice approach.

When there's no special status to display, the appbar is normally empty. However, if you prefer you can set a default message; this is a message that can never be removed from the message stack. To return to an empty appbar, set the default to an empty string.

GnomeAppBar maintains a stack of messages; it always displays the top message on the stack. (There's one exception: gnome_appbar_set_status() overrides the current top message temporarily.)

gnome_appbar_refresh() updates the appbar to reflect the current saved state. Basically this means any transient messages (created with gnome_appbar_set_status()) will disappear, to be replaced by the top of the stack or the default message.