InfoBar

Deprecated since version 4.10: There is no replacement in GTK for an “info bar” widget; you can use Revealer with a Box containing a Label and an optional Button, according to your application’s design.

class InfoBar(**properties: Any)

Superclasses: Widget, InitiallyUnowned, Object

Implemented Interfaces: Accessible, Buildable, ConstraintTarget

Constructors:

InfoBar(**properties)
new() -> Gtk.Widget

Constructors

class InfoBar
classmethod new() Widget

Creates a new GtkInfoBar object.

Deprecated since version 4.10: Please do not use it in newly written code

Methods

class InfoBar
add_action_widget(child: Widget, response_id: int) None

Add an activatable widget to the action area of a GtkInfoBar.

This also connects a signal handler that will emit the response signal on the message area when the widget is activated. The widget is appended to the end of the message areas action area.

Deprecated since version 4.10: Please do not use it in newly written code

Parameters:
  • child – an activatable widget

  • response_id – response ID for child

add_button(button_text: str, response_id: int) Button

Adds a button with the given text.

Clicking the button will emit the response signal with the given response_id. The button is appended to the end of the info bar’s action area. The button widget is returned, but usually you don’t need it.

Deprecated since version 4.10: Please do not use it in newly written code

Parameters:
  • button_text – text of button

  • response_id – response ID for the button

add_child(widget: Widget) None

Adds a widget to the content area of the info bar.

Deprecated since version 4.10: Please do not use it in newly written code

Parameters:

widget – the child to be added

get_message_type() MessageType

Returns the message type of the message area.

Deprecated since version 4.10: Please do not use it in newly written code

get_revealed() bool

Returns whether the info bar is currently revealed.

Deprecated since version 4.10: Please do not use it in newly written code

get_show_close_button() bool

Returns whether the widget will display a standard close button.

Deprecated since version 4.10: Please do not use it in newly written code

remove_action_widget(widget: Widget) None

Removes a widget from the action area of info_bar.

The widget must have been put there by a call to add_action_widget or add_button.

Deprecated since version 4.10: Please do not use it in newly written code

Parameters:

widget – an action widget to remove

remove_child(widget: Widget) None

Removes a widget from the content area of the info bar.

Deprecated since version 4.10: Please do not use it in newly written code

Parameters:

widget – a child that has been added to the content area

response(response_id: int) None

Emits the “response” signal with the given response_id.

Deprecated since version 4.10: Please do not use it in newly written code

Parameters:

response_id – a response ID

set_default_response(response_id: int) None

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 info_bar to be added to a widget hierarchy.

Deprecated since version 4.10: Please do not use it in newly written code

Parameters:

response_id – a response ID

set_message_type(message_type: MessageType) None

Sets the message type of the message area.

GTK uses this type to determine how the message is displayed.

Deprecated since version 4.10: Please do not use it in newly written code

Parameters:

message_type – a GtkMessageType

set_response_sensitive(response_id: int, setting: bool) None

Sets the sensitivity of action widgets for response_id.

Calls gtk_widget_set_sensitive (widget, setting) for each widget in the info bars’s action area with the given response_id. A convenient way to sensitize/desensitize buttons.

Deprecated since version 4.10: Please do not use it in newly written code

Parameters:
  • response_id – a response ID

  • setting – TRUE for sensitive

set_revealed(revealed: bool) None

Sets whether the GtkInfoBar is revealed.

Changing this will make info_bar reveal or conceal itself via a sliding transition.

Note: this does not show or hide info_bar in the visible sense, so revealing has no effect if visible is False.

Deprecated since version 4.10: Please do not use it in newly written code

Parameters:

revealed – The new value of the property

set_show_close_button(setting: bool) None

If true, a standard close button is shown.

When clicked it emits the response CLOSE.

Deprecated since version 4.10: Please do not use it in newly written code

Parameters:

settingTrue to include a close button

Properties

class InfoBar
props.message_type: MessageType

The type of the message.

The type may be used to determine the appearance of the info bar.

props.revealed: bool

Whether the info bar shows its contents.

props.show_close_button: bool

Whether to include a standard close button.

Signals

class InfoBar.signals
close() None

Gets emitted when the user uses a keybinding to dismiss the info bar.

The ::close signal is a keybinding signal.

The default binding for this signal is the Escape key.

response(response_id: int) None

Emitted when an action widget is clicked.

The signal is also emitted when the application programmer calls response. The response_id depends on which action widget was clicked.

Parameters:

response_id – the response ID