TeplInfoBar: Tepl 5 Reference Manual

## TeplInfoBar TeplInfoBar — Subclass of GtkInfoBar |

## Functions

TeplInfoBar * | tepl_info_bar_new ()
TeplInfoBar * | tepl_info_bar_new_simple ()
void | tepl_info_bar_add_icon ()
void | tepl_info_bar_add_primary_message ()
void | tepl_info_bar_add_secondary_message ()
void | tepl_info_bar_add_content_widget ()
void | tepl_info_bar_add_close_button ()
void | tepl_info_bar_set_buttons_orientation ()
GtkLabel * | tepl_info_bar_create_label ()

## Types and Values

| TeplInfoBar

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkBox
                        ╰── GtkInfoBar
                            ╰── TeplInfoBar

## Implemented Interfaces

TeplInfoBar implements AtkImplementorIface, GtkBuildable and GtkOrientable.

## Includes

    #include <tepl/tepl.h>

## Description

TeplInfoBar is a subclass of GtkInfoBar with functions to ease the creation of info bars.

## Functions

### tepl_info_bar_new ()

    TeplInfoBar *
    tepl_info_bar_new (void);

#### Returns

a new TeplInfoBar.

Since: 1.0

### tepl_info_bar_new_simple ()

    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.

#### Parameters

msg_type | the message type. |
primary_msg | the primary message. |
secondary_msg | the secondary message, or `NULL`. | [nullable]

#### Returns

a new TeplInfoBar.

Since: 2.0

### tepl_info_bar_add_icon ()

    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.

#### Parameters

info_bar | a TeplInfoBar. |

Since: 2.0

### tepl_info_bar_add_primary_message ()

    void
    tepl_info_bar_add_primary_message (TeplInfoBar *info_bar,
                                       const gchar *primary_msg);

Adds a primary message.

#### Parameters

info_bar | a TeplInfoBar. |
primary_msg | a primary message. |

Since: 2.0

### tepl_info_bar_add_secondary_message ()

    void
    tepl_info_bar_add_secondary_message (TeplInfoBar *info_bar,
                                         const gchar *secondary_msg);

Adds a secondary message.

#### Parameters

info_bar | a TeplInfoBar. |
secondary_msg | a secondary message. |

Since: 2.0

### tepl_info_bar_add_content_widget ()

    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.

#### Parameters

info_bar | a TeplInfoBar. |
content | a GtkWidget. |

Since: 2.0

### tepl_info_bar_add_close_button ()

    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`.

#### Parameters

info_bar | a TeplInfoBar. |

Since: 2.0

### tepl_info_bar_set_buttons_orientation ()

    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.

#### Parameters

info_bar | a TeplInfoBar. |
buttons_orientation | the desired orientation. |

Since: 5.0

### tepl_info_bar_create_label ()

    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.

#### Returns

a new GtkLabel suitable for a GtkInfoBar.

[transfer floating]

Since: 1.0

## Types and Values

### TeplInfoBar

    typedef struct _TeplInfoBar TeplInfoBar;