![]() |
![]() |
![]() |
![]() |
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkBox ╰── GtkInfoBar ╰── TeplInfoBar
TeplInfoBar is a subclass of GtkInfoBar with functions to ease the creation of info bars.
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
void
tepl_info_bar_add_icon (TeplInfoBar *info_bar
);
Adds an icon on the left, determined by the message type. So before calling
this function, gtk_info_bar_set_message_type()
must have been called.
The icon is not updated when the message type changes. Another TeplInfoBar must be created in that case.
Since: 2.0
void tepl_info_bar_add_primary_message (TeplInfoBar *info_bar
,const gchar *primary_msg
);
Adds a primary message.
Since: 2.0
void tepl_info_bar_add_secondary_message (TeplInfoBar *info_bar
,const gchar *secondary_msg
);
Adds a secondary message.
Since: 2.0
void tepl_info_bar_add_content_widget (TeplInfoBar *info_bar
,GtkWidget *content
);
Adds content
to info_bar
.
TeplInfoBar has an internal container, to be able to add the icon and add
primary or secondary messages. The internal container is added to the content
area, as returned by gtk_info_bar_get_content_area()
. So if you use a
TeplInfoBar and 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: 2.0
void
tepl_info_bar_add_close_button (TeplInfoBar *info_bar
);
Calls gtk_info_bar_set_show_close_button()
, and additionnally closes the
info_bar
when the “response” signal is received with the
response_id
GTK_RESPONSE_CLOSE
.
Since: 2.0
void tepl_info_bar_set_buttons_orientation (TeplInfoBar *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: 5.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