TeplInfoBar: libgedit-tepl 6 Reference Manual

## TeplInfoBar TeplInfoBar — Subclass of GtkInfoBar |

## Functions

TeplInfoBar * | tepl_info_bar_new ()
TeplInfoBar * | tepl_info_bar_new_simple ()
gboolean | tepl_info_bar_get_icon_from_message_type ()
void | tepl_info_bar_set_icon_from_message_type ()
const gchar * | tepl_info_bar_get_icon_name ()
void | tepl_info_bar_set_icon_name ()
void | tepl_info_bar_add_primary_message ()
void | tepl_info_bar_add_secondary_message ()
void | tepl_info_bar_add_content_widget ()
gboolean | tepl_info_bar_get_handle_close_response ()
void | tepl_info_bar_set_handle_close_response ()
void | tepl_info_bar_setup_close_button ()
void | tepl_info_bar_set_buttons_orientation ()
GtkLabel * | tepl_info_bar_create_label ()

## Properties

gboolean | handle-close-response | Read / Write / Construct
gboolean | icon-from-message-type | Read / Write / Construct
char * | icon-name | Read / Write / Construct

## Types and Values

struct | TeplInfoBar
enum | TeplInfoBarLocation

## Object Hierarchy

        GEnum
        ╰── TeplInfoBarLocation
        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkBox
                        ╰── GtkInfoBar
                            ╰── TeplInfoBar
                                ╰── TeplProgressInfoBar

## Implemented Interfaces

TeplInfoBar implements AtkImplementorIface, GtkBuildable and GtkOrientable.

## Includes

    #include <tepl/tepl.h>

## Description

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.

## 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_get_icon_from_message_type ()

    gboolean
    tepl_info_bar_get_icon_from_message_type
                                   (TeplInfoBar *info_bar);

#### Parameters

info_bar | a TeplInfoBar. |

#### Returns

the value of the “icon-from-message-type” property.

Since: 6.0

### tepl_info_bar_set_icon_from_message_type ()

    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.

#### Parameters

info_bar | a TeplInfoBar. |
icon_from_message_type | the new value. |

Since: 6.0

### tepl_info_bar_get_icon_name ()

    const gchar *
    tepl_info_bar_get_icon_name (TeplInfoBar *info_bar);

#### Parameters

info_bar | a TeplInfoBar. |

#### Returns

the value of the “icon-name” property.

Since: 6.0

### tepl_info_bar_set_icon_name ()

    void
    tepl_info_bar_set_icon_name (TeplInfoBar *info_bar,
                                 const gchar *icon_name);

Sets a new value to the “icon-name” property.

#### Parameters

info_bar | a TeplInfoBar. |
icon_name | the new value. |

Since: 6.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 to the `TEPL_INFO_BAR_LOCATION_ALONGSIDE_ICON` location.

#### 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 to the `TEPL_INFO_BAR_LOCATION_ALONGSIDE_ICON` location.

#### 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 *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.

#### Parameters

info_bar | a TeplInfoBar. |
widget | a GtkWidget. |
location | a TeplInfoBarLocation. |

Since: 6.0

### tepl_info_bar_get_handle_close_response ()

    gboolean
    tepl_info_bar_get_handle_close_response
                                   (TeplInfoBar *info_bar);

#### Parameters

info_bar | a TeplInfoBar. |

#### Returns

the value of the “handle-close-response” property.

Since: 6.0

### tepl_info_bar_set_handle_close_response ()

    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.

#### Parameters

info_bar | a TeplInfoBar. |
handle_close_response | the new value. |

Since: 6.0

### tepl_info_bar_setup_close_button ()

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

#### Parameters

info_bar | a TeplInfoBar. |

Since: 6.0

### tepl_info_bar_set_buttons_orientation ()

    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.

#### Parameters

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

Since: 6.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

### struct TeplInfoBar

    struct TeplInfoBar;

### enum TeplInfoBarLocation

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.

#### Members

TEPL_INFO_BAR_LOCATION_ALONGSIDE_ICON | on the right side of the icon. |
TEPL_INFO_BAR_LOCATION_BELOW_ICON | below the icon. |

Since: 6.0

## Property Details

### The `“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

### The `“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

### The `“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