Tepl.InfoBar

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.Orientable Gtk.Orientable GObject.GInterface->Gtk.Orientable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Box Gtk.Box Gtk.InfoBar Gtk.InfoBar Gtk.Box->Gtk.InfoBar Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.Container->Gtk.Box Tepl.InfoBar Tepl.InfoBar Gtk.InfoBar->Tepl.InfoBar Gtk.Orientable->Gtk.Box Gtk.Widget->Gtk.Container

Subclasses:

Tepl.ProgressInfoBar

Methods

Inherited:

Gtk.InfoBar (14), Gtk.Box (14), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Orientable (2)

Structs:

Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)

class

create_label ()

class

new ()

class

new_simple (msg_type, primary_msg, secondary_msg)

class

set_buttons_orientation (info_bar, buttons_orientation)

add_content_widget (widget, location)

add_primary_message (primary_msg)

add_secondary_message (secondary_msg)

get_handle_close_response ()

get_icon_from_message_type ()

get_icon_name ()

set_handle_close_response (handle_close_response)

set_icon_from_message_type (icon_from_message_type)

set_icon_name (icon_name)

setup_close_button ()

Virtual Methods

Inherited:

Gtk.InfoBar (2), Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10)

Properties

Inherited:

Gtk.InfoBar (3), Gtk.Box (3), Gtk.Container (3), Gtk.Widget (39), Gtk.Orientable (1)

Name

Type

Flags

Short Description

handle-close-response

bool

r/w/c

icon-from-message-type

bool

r/w/c

icon-name

str

r/w/c

Child Properties

Inherited:

Gtk.Box (5)

Style Properties

Inherited:

Gtk.InfoBar (4), Gtk.Widget (17)

Signals

Inherited:

Gtk.InfoBar (2), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Fields

Inherited:

Gtk.InfoBar (2), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Name

Type

Access

Description

parent

Gtk.InfoBar

r

Class Details

class Tepl.InfoBar(*args, **kwargs)
Bases:

Gtk.InfoBar

Abstract:

No

Structure:

Tepl.InfoBarClass

classmethod create_label()
Returns:

a new Gtk.Label suitable for a Gtk.InfoBar.

Return type:

Gtk.Label

Utility function to create a Gtk.Label suitable for a Gtk.InfoBar. The wrapping and alignment is configured. The label is also set as selectable, for example to copy an error message and search an explanation on the web.

New in version 1.0.

classmethod new()
Returns:

a new Tepl.InfoBar.

Return type:

Tepl.InfoBar

New in version 1.0.

classmethod new_simple(msg_type, primary_msg, secondary_msg)
Parameters:
  • msg_type (Gtk.MessageType) – the message type.

  • primary_msg (str) – the primary message.

  • secondary_msg (str or None) – the secondary message, or None.

Returns:

a new Tepl.InfoBar.

Return type:

Tepl.InfoBar

Creates a new Tepl.InfoBar with an icon (depending on msg_type), a primary message and a secondary message.

New in version 2.0.

classmethod set_buttons_orientation(info_bar, buttons_orientation)
Parameters:

Sets the desired orientation (horizontal or vertical) for the action area as returned by Gtk.InfoBar.get_action_area(). The action area is where the buttons are placed.

The default value for a Tepl.InfoBar is Gtk.Orientation.VERTICAL. The reason is because with a small Gtk.Window, if 3 or more buttons are shown horizontally, there is not enough space for the text. And it can be worse when the button labels are translated to another language. When the buttons are packed vertically, there is usually no problem. A vertical action area also follows the original design of Gtk.InfoBar.

New in version 6.0.

add_content_widget(widget, location)
Parameters:

Adds widget to self at location.

As described in Tepl.InfoBarLocation, a Tepl.InfoBar has internal containers for the content area. So if you need to add a custom Gtk.Widget, it is better to use this function instead of adding the Gtk.Widget directly to the content area.

New in version 6.0.

add_primary_message(primary_msg)
Parameters:

primary_msg (str) – a primary message.

Adds a primary message to the Tepl.InfoBarLocation.ALONGSIDE_ICON location.

New in version 2.0.

add_secondary_message(secondary_msg)
Parameters:

secondary_msg (str) – a secondary message.

Adds a secondary message to the Tepl.InfoBarLocation.ALONGSIDE_ICON location.

New in version 2.0.

get_handle_close_response()
Returns:

the value of the Tepl.InfoBar :handle-close-response property.

Return type:

bool

New in version 6.0.

get_icon_from_message_type()
Returns:

the value of the Tepl.InfoBar :icon-from-message-type property.

Return type:

bool

New in version 6.0.

get_icon_name()
Returns:

the value of the Tepl.InfoBar :icon-name property.

Return type:

str

New in version 6.0.

set_handle_close_response(handle_close_response)
Parameters:

handle_close_response (bool) – the new value.

Sets a new value to the Tepl.InfoBar :handle-close-response property.

New in version 6.0.

set_icon_from_message_type(icon_from_message_type)
Parameters:

icon_from_message_type (bool) – the new value.

Sets a new value to the Tepl.InfoBar :icon-from-message-type property.

New in version 6.0.

set_icon_name(icon_name)
Parameters:

icon_name (str) – the new value.

Sets a new value to the Tepl.InfoBar :icon-name property.

New in version 6.0.

setup_close_button()

Convenience function to set the Gtk.InfoBar :show-close-button and Tepl.InfoBar :handle-close-response properties to True.

New in version 6.0.

Property Details

Tepl.InfoBar.props.handle_close_response
Name:

handle-close-response

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT

If this property is True, then the Tepl.InfoBar is destroyed with Gtk.Widget.destroy() when the Gtk.InfoBar ::response signal is received with the response_id Gtk.ResponseType.CLOSE.

New in version 6.0.

Tepl.InfoBar.props.icon_from_message_type
Name:

icon-from-message-type

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT

If this property is True, then an icon is shown on the left, based on the value of the Gtk.InfoBar :message-type property. For Gtk.MessageType.OTHER no icon is shown.

If the Tepl.InfoBar :icon-name property has a non-None value, then this property is not taken into account.

Note that setting this property doesn’t change the value of the Tepl.InfoBar :icon-name property; the two properties are separate.

New in version 6.0.

Tepl.InfoBar.props.icon_name
Name:

icon-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

If set to a non-None value, then an icon is shown on the left.

If this property has a non-None value, then the Tepl.InfoBar :icon-from-message-type property is not taken into account.

New in version 6.0.