gtk.InfoBar

gtk.InfoBar — report important messages to the user (new in PyGTK 2.22)

Synopsis

class gtk.InfoBar(gtk.HBox):
    gtk.InfoBar()

def get_action_area()

def get_content_area()

def add_action_widget(child, response_id)

def add_button(button_text, response_id)

def add_buttons(first_button_text)

def set_response_sensitive(response_id, setting)

def set_default_response(response_id)

def response(response_id)

def set_message_type(message_type)

def get_message_type()

Ancestry

+-- GObject
  +-- gtk.Object
    +-- gtk.Widget
      +-- gtk.Container
        +-- gtk.Box
          +-- gtk.HBox
            +-- gtk.InfoBar

Implemented Interfaces

gtk.InfoBar implements gtk.Buildable atk.ImplementorIFace

gtk.InfoBar Properties

gtk.Object Properties

gtk.Widget Properties

gtk.Container Properties

gtk.Box Properties

"message-type"Read-Write-ConstructThe type of the message. The type is used to determine the colors to use in the info bar. The following symbolic color names can by used to customize these colors: "info_fg_color", "info_bg_color", "warning_fg_color", "warning_bg_color", "question_fg_color", "question_bg_color", "error_fg_color", "error_bg_color". "other_fg_color", "other_bg_color". If the type is gtk.MESSAGE_OTHER, no info bar is painted but the colors are still set. Default value: gtk.MESSAGE_INFO This property is available in GTK+ 2.18 and above.

gtk.InfoBar Style Properties

gtk.Widget Style Properties

"action-area-border"ReadWidth of the border around the action area of the info bar. Allowed values: >= 0 Default value: 5 This property is available in GTK+ 2.18 and above.
"button-spacing"ReadSpacing between buttons in the action area of the info bar. Allowed values: >=0 Default value: 6 This property is available in GTK+ 2.18 and above.
"content-area-border"ReadThe width of the border around the content content area of the info bar. Allowed values: >=0 Default value: 8 This property is available in GTK+ 2.18 and above.
"content-area-spacing"ReadThe default spacing used between elements of the content area of the info bar. Allowed values: >=0 Default value: 16 This property is available in GTK+ 2.18 and above.

gtk.InfoBar Signal Prototypes

gobject.GObject Signal Prototypes

gtk.Object Signal Prototypes

gtk.Widget Signal Prototypes

gtk.Container Signal Prototypes

"close"

def callback(infobar, user_param1, ...)

"response"

def callback(infobar, response_id, user_param1, ...)

Description

Note

This widget is available in PyGTK 2.22 and above.

gtk.InfoBar is a widget that can be used to show messages to the user without showing a dialog. It is often temporarily shown at the top or bottom of a document. In contrast to gtk.Dialog, which has a horizontal action area at the bottom, gtk.InfoBar has a vertical action area at the side.

Constructor

    gtk.InfoBar()

Returns :

a new gtk.InfoBar object

Note

This constructor is available in PyGTK 2.22 and above.

Creates a new gtk.InfoBar object.

Methods

gtk.InfoBar.get_action_area

    def get_action_area()

Returns :

the action area

Note

This method is available in PyGTK 2.22 and above.

The get_action_area() method returns the action area of the infobar.

gtk.InfoBar.get_content_area

    def get_content_area()

Returns :

the content area

Note

This method is available in PyGTK 2.22 and above.

The get_content_area() method returns the content area of the infobar.

gtk.InfoBar.add_action_widget

    def add_action_widget(child, response_id)

child :

an activatable widget

response_id :

response ID for child

Note

This method is available in PyGTK 2.22 and above.

Add an activatable widget to the action area of a gtk.InfoBar, connecting a signal handler that will emit the gtk.InfoBar::response signal on the message area when the widget is activated. The widget is appended to the end of the message areas action area.

gtk.InfoBar.add_button

    def add_button(button_text, response_id)

button_text :

text of button, or stock ID

response_id :

response ID for the button

Returns :

the button widget that was added

Note

This method is available in PyGTK 2.22 and above.

Adds a button with the given text (or a stock button, if button_text is a stock ID) and sets things up so that clicking the button will emit the "response" signal with the given response_id. The button is appended to the end of the info bars's action area. The button widget is returned, but usually you don't need it.

gtk.InfoBar.add_buttons

    def add_buttons(first_button_text, first_response_id, ...)

first_button_text :

button text or stock ID

first_response_id :

response ID for the button

Note

This method is available in PyGTK 2.22 and above.

Adds more buttons, same as calling add_button() repeatedly. Each button must have both text and response ID.

gtk.InfoBar.set_response_sensitive

    def set_response_sensitive(response_id, setting)

response_id :

a response ID

setting :

TRUE for sensitive

Note

This method is available in PyGTK 2.22 and above.

Calls gtk.Widget.set_sensitive() for each widget in the info bars's action area with the given response_id. A convenient way to sensitize/desensitize dialog buttons.

gtk.InfoBar.set_default_response

    def set_default_response(response_id)

response_id :

a response ID

Note

This method is available in PyGTK 2.22 and above.

The set_default_response() method sets the last widget in the info bar's action area with the given response_id as the default widget for the dialog. Pressing "Enter" normally activates the default widget.

Note that this function currently requires the infobar to be added to a widget hierarchy.

gtk.InfoBar.response

    def response(response_id)

response_id :

a response ID

Note

This method is available in PyGTK 2.22 and above.

Emits the 'response' signal with the given response_id.

gtk.InfoBar.set_message_type

    def set_message_type(message_type)

message_type :

a GtkMessageType

Note

This method is available in PyGTK 2.22 and above.

The set_message_type() method sets the message type of the message area. GTK+ uses this type to determine what color to use when drawing the message area.

gtk.InfoBar.get_message_type

    def get_message_type()

Returns :

the message type of the message area.

Note

This method is available in PyGTK 2.22 and above.

The get_message_type() method returns the message type of the message area.

Signals

The "close" gtk.InfoBar Signal

    def callback(infobar, user_param1, ...)

infobar :

the infobar that received the signal

user_param1 :

the first user parameter (if any) specified with the connect() method

... :

additional user parameters (if any)

Note

This signal is available in GTK+ 2.18 and above.

The "close" signal keybinding signal which gets emitted when the user uses a keybinding to dismiss the info bar. The default binding for this signal is the Escape key.

The "response" gtk.InfoBar Signal

    def callback(infobar, response_id, user_param1, ...)

infobar :

the infobar that received the signal

response_id :

the response ID

user_param1 :

the first user parameter (if any) specified with the connect() method

... :

additional user parameters (if any)

Note

This signal is available in GTK+ 2.18 and above.

The "response" signal is emitted when an action widget is clicked or the application programmer calls response(). The response_id depends on which action widget was clicked.