Top |
TeplInfoBarTeplInfoBar — Subclass of GtkInfoBar |
gboolean | handle-close-response | Read / Write / Construct |
gboolean | icon-from-message-type | Read / Write / Construct |
char * | icon-name | Read / Write / Construct |
GEnum ╰── TeplInfoBarLocation GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkBox ╰── GtkInfoBar ╰── TeplInfoBar ╰── TeplProgressInfoBar
TeplInfoBar is a subclass of GtkInfoBar. In most cases it permits to create GtkInfoBar's more easily.
The content area is divided into several sub-areas, described in TeplInfoBarLocation.
TeplInfoBar * tepl_info_bar_new_simple (GtkMessageType msg_type
,const gchar *primary_msg
,const gchar *secondary_msg
);
Creates a new TeplInfoBar with an icon (depending on msg_type
), a primary
message and a secondary message.
msg_type |
the message type. |
|
primary_msg |
the primary message. |
|
secondary_msg |
the secondary message, or |
[nullable] |
Since: 2.0
gboolean
tepl_info_bar_get_icon_from_message_type
(TeplInfoBar *info_bar
);
Since: 6.0
void tepl_info_bar_set_icon_from_message_type (TeplInfoBar *info_bar
,gboolean icon_from_message_type
);
Sets a new value to the “icon-from-message-type” property.
Since: 6.0
const gchar *
tepl_info_bar_get_icon_name (TeplInfoBar *info_bar
);
Since: 6.0
void tepl_info_bar_set_icon_name (TeplInfoBar *info_bar
,const gchar *icon_name
);
Sets a new value to the “icon-name” property.
Since: 6.0
void tepl_info_bar_add_primary_message (TeplInfoBar *info_bar
,const gchar *primary_msg
);
Adds a primary message to the TEPL_INFO_BAR_LOCATION_ALONGSIDE_ICON
location.
Since: 2.0
void tepl_info_bar_add_secondary_message (TeplInfoBar *info_bar
,const gchar *secondary_msg
);
Adds a secondary message to the TEPL_INFO_BAR_LOCATION_ALONGSIDE_ICON
location.
Since: 2.0
void tepl_info_bar_add_content_widget (TeplInfoBar *info_bar
,GtkWidget *widget
,TeplInfoBarLocation location
);
Adds widget
to info_bar
at location
.
As described in TeplInfoBarLocation, a TeplInfoBar has internal containers for the content area. So if you need to add a custom GtkWidget, it is better to use this function instead of adding the GtkWidget directly to the content area.
Since: 6.0
gboolean
tepl_info_bar_get_handle_close_response
(TeplInfoBar *info_bar
);
Since: 6.0
void tepl_info_bar_set_handle_close_response (TeplInfoBar *info_bar
,gboolean handle_close_response
);
Sets a new value to the “handle-close-response” property.
Since: 6.0
void
tepl_info_bar_setup_close_button (TeplInfoBar *info_bar
);
Convenience function to set the “show-close-button” and
“handle-close-response” properties to TRUE
.
Since: 6.0
void tepl_info_bar_set_buttons_orientation (GtkInfoBar *info_bar
,GtkOrientation buttons_orientation
);
Sets the desired orientation (horizontal or vertical) for the action area as
returned by gtk_info_bar_get_action_area()
. The action area is where the
buttons are placed.
The default value for a TeplInfoBar is GTK_ORIENTATION_VERTICAL
. The reason
is because with a small GtkWindow, 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 GtkInfoBar.
Since: 6.0
GtkLabel *
tepl_info_bar_create_label (void
);
Utility function to create a GtkLabel suitable for a GtkInfoBar. 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.
Since: 1.0
Location inside the content area.
The content area of a TeplInfoBar contains a vertical container containing:
First, an horizontal container containing:
A place for an optional icon.
The TEPL_INFO_BAR_LOCATION_ALONGSIDE_ICON
location, which is a vertical
container that can contain: primary/secondary messages plus additional
widgets, in the order that they are added.
The TEPL_INFO_BAR_LOCATION_BELOW_ICON
location, which can contain
additional widgets, in the order that they are added. So the widgets added
here are under the icon and under the
TEPL_INFO_BAR_LOCATION_ALONGSIDE_ICON
location.
Since: 6.0
“handle-close-response”
property“handle-close-response” gboolean
If this property is TRUE
, then the TeplInfoBar is destroyed with
gtk_widget_destroy()
when the “response” signal is
received with the response_id
GTK_RESPONSE_CLOSE
.
Owner: TeplInfoBar
Flags: Read / Write / Construct
Default value: FALSE
Since: 6.0
“icon-from-message-type”
property“icon-from-message-type” gboolean
If this property is TRUE
, then an icon is shown on the left, based
on the value of the “message-type” property. For
GTK_MESSAGE_OTHER
no icon is shown.
If the “icon-name” property has a non-NULL
value, then
this property is not taken into account.
Note that setting this property doesn't change the value of the “icon-name” property; the two properties are separate.
Owner: TeplInfoBar
Flags: Read / Write / Construct
Default value: FALSE
Since: 6.0
“icon-name”
property “icon-name” char *
If set to a non-NULL
value, then an icon is shown on the left.
If this property has a non-NULL
value, then the
“icon-from-message-type” property is not taken into
account.
Owner: TeplInfoBar
Flags: Read / Write / Construct
Default value: NULL
Since: 6.0