Tepl.InfoBar¶
- Subclasses:
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 |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Gtk.InfoBar (3), Gtk.Box (3), Gtk.Container (3), Gtk.Widget (39), Gtk.Orientable (1)
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/c |
|||
r/w/c |
|||
r/w/c |
Child Properties¶
- Inherited:
Style Properties¶
- Inherited:
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 |
r |
Class Details¶
- class Tepl.InfoBar(*args, **kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod create_label()¶
- Returns:
a new
Gtk.Label
suitable for aGtk.InfoBar
.- Return type:
Utility function to create a
Gtk.Label
suitable for aGtk.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:
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
orNone
) – the secondary message, orNone
.
- Returns:
a new
Tepl.InfoBar
.- Return type:
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:
info_bar (
Gtk.InfoBar
) – aGtk.InfoBar
.buttons_orientation (
Gtk.Orientation
) – the desired orientation.
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
isGtk.Orientation.VERTICAL
. The reason is because with a smallGtk.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 ofGtk.InfoBar
.New in version 6.0.
- add_content_widget(widget, location)¶
- Parameters:
widget (
Gtk.Widget
) – aGtk.Widget
.location (
Tepl.InfoBarLocation
) – aTepl.InfoBarLocation
.
Adds widget to self at location.
As described in
Tepl.InfoBarLocation
, aTepl.InfoBar
has internal containers for the content area. So if you need to add a customGtk.Widget
, it is better to use this function instead of adding theGtk.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:
New in version 6.0.
- get_icon_from_message_type()¶
- Returns:
the value of the
Tepl.InfoBar
:icon-from-message-type
property.- Return type:
New in version 6.0.
- get_icon_name()¶
- Returns:
the value of the
Tepl.InfoBar
:icon-name
property.- Return type:
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
andTepl.InfoBar
:handle-close-response
properties toTrue
.New in version 6.0.
Property Details¶
- Tepl.InfoBar.props.handle_close_response¶
-
If this property is
True
, then theTepl.InfoBar
is destroyed withGtk.Widget.destroy
() when theGtk.InfoBar
::response
signal is received with the response_idGtk.ResponseType.CLOSE
.New in version 6.0.
- Tepl.InfoBar.props.icon_from_message_type¶
-
If this property is
True
, then an icon is shown on the left, based on the value of theGtk.InfoBar
:message-type
property. ForGtk.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¶
-
If set to a non-
None
value, then an icon is shown on the left.If this property has a non-
None
value, then theTepl.InfoBar
:icon-from-message-type
property is not taken into account.New in version 6.0.