Report important messages to the user

Methods and Functions

gtkInfoBarNew(show = TRUE) gtkInfoBarNewWithButtons(first.button.text, ..., show = TRUE) gtkInfoBarAddActionWidget(object, child, gtkInfoBarAddButton(object, button.text, gtkInfoBarAddButtons(object, first.button.text, ...) gtkInfoBarSetResponseSensitive(object,, setting) gtkInfoBarSetDefaultResponse(object, gtkInfoBarResponse(object, gtkInfoBarSetMessageType(object, message.type) gtkInfoBarGetMessageType(object) gtkInfoBarGetActionArea(object) gtkInfoBarGetContentArea(object) gtkInfoBar(first.button.text, ..., show = TRUE)




GtkInfoBar implements AtkImplementorIface, GtkBuildable and GtkOrientable.

Detailed Description

GtkInfoBar is a widget that can be used to show messages to the user without showing a dialog. It is often temporarily shown at the top or bottom of a document. In contrast to GtkDialog, which has a horizontal action area at the bottom, GtkInfoBar has a vertical action area at the side. The API of GtkInfoBar is very similar to GtkDialog, allowing you to add buttons to the action area with gtkInfoBarAddButton or gtkInfoBarNewWithButtons. The sensitivity of action widgets can be controlled with gtkInfoBarSetResponseSensitive. To add widgets to the main content area of a GtkInfoBar, use gtkInfoBarGetContentArea and add your widgets to the container. Similar to GtkMessageDialog, the contents of a GtkInfoBar can by classified as error message, warning, informational message, etc, by using gtkInfoBarSetMessageType. GTK+ uses the message type to determine the background color of the message area. Simple GtkInfoBar usage.

/* set up info bar */
info_bar = gtk_info_bar_new ();
gtk_widget_set_no_show_all (info_bar, TRUE);
message_label = gtk_label_new ("");
gtk_widget_show (message_label);
content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (info_bar));
gtk_container_add (GTK_CONTAINER (content_area), message_label);
gtk_info_bar_add_button (GTK_INFO_BAR (info_bar),
                         GTK_STOCK_OK, GTK_RESPONSE_OK);
g_signal_connect (info_bar, "response",
                  G_CALLBACK (gtk_widget_hide), NULL);
gtk_table_attach (GTK_TABLE (table),
                  0, 1, 2, 3,
                  GTK_EXPAND | GTK_FILL,  0,
                  0,                      0); /* ... */ /* show an error message */
gtk_label_set_text (GTK_LABEL (message_label), error_message);
gtk_info_bar_set_message_type (GTK_INFO_BAR (info_bar),
gtk_widget_show (info_bar);
GtkInfoBar as GtkBuildable The GtkInfoBar implementation of the GtkBuildable interface exposes the content area and action area as internal children with the names "content_area" and "action_area". GtkInfoBar supports a custom element, which can contain multiple elements. The "response" attribute specifies a numeric response, and the content of the element is the id of widget (which should be a child of the dialogs action.area).


Convenient Construction

gtkInfoBar is the result of collapsing the constructors of GtkInfoBar (gtkInfoBarNew, gtkInfoBarNewWithButtons) and accepts a subset of its arguments matching the required arguments of one of its delegate constructors.


The ::close signal is a keybinding signal which gets emitted when the user uses a keybinding to dismiss the info bar. The default binding for this signal is the Escape key. Since 2.18
Emitted when an action widget is clicked or the application programmer calls gtkDialogResponse. The depends on which action widget was clicked. Since 2.18
the object on which the signal is emitted
the response ID
user data set when the signal handler was connected.


Style Properties

action-area-border [integer : Read]
Width of the border around the action area of the info bar. Allowed values: >= 0 Default value: 5 Since 2.18
button-spacing [integer : Read]
Spacing between buttons in the action area of the info bar. Allowed values: >= 0 Default value: 6 Since 2.18
content-area-border [integer : Read]
The width of the border around the content content area of the info bar. Allowed values: >= 0 Default value: 8 Since 2.18
content-area-spacing [integer : Read]
The default spacing used between elements of the content area of the info bar. Allowed values: >= 0 Default value: 16 Since 2.18


  • GtkInfoBar
  • gtkInfoBar
Documentation reproduced from package RGtk2, version 2.20.31, License: GPL

Community examples

Looks like there are no examples yet.