gtk.Statusbar
Prev | The gtk Class Reference | Next

## gtk.Statusbar

gtk.Statusbar — report messages of minor importance to the user.

## Synopsis

    class gtk.Statusbar(gtk.HBox):
        gtk.Statusbar()
        def get_context_id(context_description)
        def push(context_id, text)
        def pop(context_id)
        def remove_message(context_id, message_id)
        def remove(context_id, message_id)
        def remove_all(context_id)
        def set_has_resize_grip(setting)
        def get_has_resize_grip()
        def get_message_area()

## Ancestry

    +-- gobject.GObject
      +-- gtk.Object
        +-- gtk.Widget
          +-- gtk.Container
            +-- gtk.Box
              +-- gtk.HBox
                +-- gtk.Statusbar

## Implemented Interfaces

`gtk.Statusbar` implements `gtk.Buildable`

## gtk.Statusbar Properties

gtk.Object Properties

gtk.Widget Properties

gtk.Container Properties

gtk.Box Properties

"has-resize-grip" | Read-Write | If `True`, the statusbar has a grip for resizing the toplevel window. Available in GTK+ 2.4 and above.

## gtk.Statusbar Style Properties

gtk.Widget Style Properties

"shadow-type" | Read | The style of bevel around the statusbar text

## gtk.Statusbar Child Properties

gtk.Box Child Properties

## gtk.Statusbar Signal Prototypes

gobject.GObject Signal Prototypes

gtk.Object Signal Prototypes

gtk.Widget Signal Prototypes

gtk.Container Signal Prototypes

"text-popped" | `def callback(`statusbar`, `context_id`, `text`, `user_param1`, `...`)`
"text-pushed" | `def callback(`statusbar`, `context_id`, `text`, `user_param1`, `...`)`

## Description

A `gtk.Statusbar` is usually placed along the bottom of an application's main `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). It may also have a resize grip (a triangular area in the lower right corner) which can be clicked on to resize the window containing the statusbar. Status bars in PyGTK 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. The `context_id` can be generated by the `get_context_id`() method, and associated with a context message. An existing context_id can be retrieved using the context message using the `get_context_id`() method. 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.

## Constructor

        gtk.Statusbar()

Returns : | a new `gtk.Statusbar` widget

Creates a new `gtk.Statusbar` widget.

## Methods

### gtk.Statusbar.get_context_id

        def get_context_id(context_description)

`context_description` : | a string identifying the context for the message
Returns : | an integer context identifier

The `get_context_id`() method returns a new or existing context identifier, given a description of the actual context specified by `context_description`. In effect, `get_context_id`() both registers and retrieves a context identifier.

### gtk.Statusbar.push

        def push(context_id, text)

`context_id` : | a context identifier
`text` : | the message text
Returns : | an integer message identifier

The `push`() method pushes a new message specified by `text` with the specified `context_id` onto a statusbar's stack and returns a message id that that can be used with the `remove_message`() method.

### gtk.Statusbar.pop

        def pop(context_id)

`context_id` : | a context identifier

The `pop`() method removes the top message with the specified `context_id` from the statusbar's stack.

### gtk.Statusbar.remove_message

        def remove_message(context_id, message_id)

`context_id` : | the context identifier
`message_id` : | the message identifier

The `remove_message`() method removes the message with the specified `message_id` and `context_id` from the statusbar's message stack.

### gtk.Statusbar.remove

### Warning

This method is deprecated in PyGTK 2.22 and above

This method calls either gtk.Container.remove or gtk.Statusbar.remove_message depending on parameters. The second option is for compatibility only and will be eventually removed. New code should use `remove` only to remove widgets (as in `gtk.Container` method). To remove messages, use gtk.Statusbar.remove_message directly.

### gtk.StatusBar.remove_all

        def remove_all(context_id)

`context_id` : | a context identifier.

### Note

This method is available in PyGTK 2.22 and above.

The `remove_all`() method forces the removal of all messages from a statusbar's stack with the exact `context_id`.

### gtk.Statusbar.set_has_resize_grip

        def set_has_resize_grip(setting)

`setting` : | if `True` a resize grip is displayed

The `set_has_resize_grip`() method sets the internal "has_resize_grip" property to the value specified by `setting`. If `setting` is `True` a resize grip is displayed on the statusbar

### gtk.Statusbar.get_has_resize_grip

        def get_has_resize_grip()

Returns : | `True` if a resize grip is displayed

The `get_has_resize_grip`() method returns the value of the internal "has_resize_grip" property that determines if a resize grip is displayed on the statusbar.

### gtk.StatusBar.get_message_area

        def get_message_area()

Returns : | a `gtk.Box`.

### Note

This method is available in PyGTK 2.22 and above.

The `get_message_area`() method retrieves the box containing the label widget.

## Signals

### The "text-popped" gtk.Statusbar Signal

        def callback(statusbar, context_id, text, user_param1, ...)

`statusbar` : | the statusbar that received the signal
`context_id` : | the context identifier of the top message
`text` : | the string containing the top message text
`user_param1` : | the first user parameter (if any) specified with the `connect`() method
`...` : | additional user parameters (if any)

The "text-popped" signal is emitted when a message is removed from the statusbar message stack. Note the text and context_id are for the top message on the statusbar stack not the message that was actually removed.

### The "text-pushed" gtk.Statusbar Signal

        def callback(statusbar, context_id, text, user_param1, ...)

`statusbar` : | the statusbar that received the signal
`context_id` : | the context identifier of the message added
`text` : | the string containing the message text
`user_param1` : | the first user parameter (if any) specified with the `connect`() method
`...` : | additional user parameters (if any)

The "text-pushed" signal is emitted when a message is added to the statusbar message stack.

Prev | Up | Next
gtk.Spinner | Home | gtk.StatusIcon