11.75Class GtkInfoBar

Report important messages to the user

Class GtkInfoBar

GtkInfoBar 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 GtkDialog, which has a horizontal action area at the bottom, GtkInfoBar has a vertical action area at the side.

The API of GtkInfoBar is very similar to GtkDialog, allowing you to add buttons to the action area with add_button() or new_with_buttons(). The sensitivity of action widgets can be controlled with set_response_sensitive(). To add widgets to the main content area of a GtkInfoBar, use get_content_area() and add your widgets to the container.

Similar to GtkMessageDialog, the contents of a GtkInfoBar can by classified as error message, warning, informational message, etc, by using set_message_type(). GTK+ uses the message type to determine the background color of the message area.

[...]

Methods
add_action_widgetAdd an activatable widget to the action area of a GtkInfoBar, connecting a signal handler that will emit the "response" signal on the message area when the widget is activated.
add_buttonAdds 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.
get_action_areaReturns the action area of info_bar.
get_content_areaReturns the content area of info_bar.
get_message_typeReturns the message type of the message area.
responseEmits the 'response' signal with the given response_id.
set_default_responseSets the last widget in the info bar's action area with the given response_id as the default widget for the dialog.
set_message_typeSets the message type of the message area (GtkMessageType).
set_response_sensitiveCalls gtk_widget_set_sensitive (widget, setting) for each widget in the info bars's action area with the given response_id.

Methods

add_action_widget

Add an activatable widget to the action area of a GtkInfoBar, connecting a signal handler that will emit the "response" signal on the message area when the widget is activated.

GtkInfoBar.add_action_widget( child, response_id )
child an activatable widget
response_id response ID for child (integer).

The widget is appended to the end of the message areas action area.

add_button

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.

GtkInfoBar.add_button( button_text, response_id )
button_text text of button, or stock ID
response_id response ID for the button
Returnthe button widget that was added

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.

get_action_area

Returns the action area of info_bar.

GtkInfoBar.get_action_area()
Returnthe action area.

get_content_area

Returns the content area of info_bar.

GtkInfoBar.get_content_area()
Returnthe content area.

get_message_type

Returns the message type of the message area.

GtkInfoBar.get_message_type()
Returnthe message type of the message area.

response

Emits the 'response' signal with the given response_id.

GtkInfoBar.response( response_id )
response_id a response ID

set_default_response

Sets the last widget in the info bar's action area with the given response_id as the default widget for the dialog.

GtkInfoBar.set_default_response()

Pressing "Enter" normally activates the default widget.

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

set_message_type

Sets the message type of the message area (GtkMessageType).

GtkInfoBar.set_message_type()

GTK+ uses this type to determine what color to use when drawing the message area.

set_response_sensitive

Calls gtk_widget_set_sensitive (widget, setting) for each widget in the info bars's action area with the given response_id.

GtkInfoBar.set_response_sensitive( response_id, setting )
response_id a response ID
setting true for sensitive

A convenient way to sensitize/desensitize dialog buttons.

Made with http://www.falconpl.org