# Gtk::InfoBar Class Reference
[Widgets]

This widget that can be used to show messages to the user without showing a dialog. More...

Inherits Gtk::HBox.

Collaboration diagram for Gtk::InfoBar:
[legend]

List of all members.

## Public Member Functions

virtual | ~InfoBar ()
GtkInfoBar* | gobj ()
| Provides access to the underlying C GtkObject.
const GtkInfoBar* | gobj () const
| Provides access to the underlying C GtkObject.
| InfoBar ()
Widget* | get_action_area ()
| Returns: the action area.
const Widget* | get_action_area () const
| Returns: the action area.
Widget* | get_content_area ()
| Returns: the content area.
const Widget* | get_content_area () const
| Returns: the content area.
void | add_action_widget (Widget& child, int response_id)
| Add an activatable widget to the action area of a Gtk::InfoBar, connecting a signal handler that will emit the Gtk::InfoBar::response signal on the message area when the widget is activated.
Button* | add_button (const Glib::ustring& button_text, int response_id)
| Adds a button with the given text (or a stock button, if button_text is a stock ID) and sets things up so that clicking the button will emit the "response" signal with the given response_id.
Button* | add_button (const Gtk::StockID& stock_id, int response_id)
| Adds a button with the given text (or a stock button, if button_text is a stock ID) and sets things up so that clicking the button will emit the "response" signal with the given response_id.
void | set_response_sensitive (int response_id, bool setting=true)
| Calls gtk_widget_set_sensitive (widget, setting) for each widget in the info bars's action area with the given response_id.
void | set_default_response (int response_id)
| Sets the last widget in the info bar's action area with the given response_id as the default widget for the dialog.
void | response (int response_id)
| Emits the 'response' signal with the given response_id.
void | set_message_type (MessageType message_type)
| Sets the message type of the message area.
MessageType | get_message_type () const
| Returns: the message type of the message area.
Glib::SignalProxy1< void, int > | signal_response ()
Glib::PropertyProxy< MessageType > | property_message_type ()
| The type of message.
Glib::PropertyProxy_ReadOnly < MessageType > | property_message_type () const
| The type of message.

## Protected Member Functions

virtual void | on_response (int response_id)

## Related Functions

(Note that these are not member functions.)
Gtk::InfoBar* | wrap (GtkInfoBar* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

This 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 Dialog, which has a horizontal action area at the bottom, InfoBar has a vertical action area at the side.

The API is very similar to Dialog, allowing you to add buttons to the action area with add_button(). The sensitivity of action widgets can be controlled with set_response_sensitive(). To add widgets to the main content area, use get_content_area() and add your widgets to the container.

Similar to MessageDialog, the contents can by classified as error message, warning, informational message, etc, by using set_message_type(). This determines the background color of the message area.

The InfoBar widget looks like

Since gtkmm 2.18:

## Constructor & Destructor Documentation

virtual Gtk::InfoBar::~InfoBar | ( |  | ) | `[virtual]`

Gtk::InfoBar::InfoBar | ( |  | ) |

## Member Function Documentation

void Gtk::InfoBar::add_action_widget | ( | Widget& | child,
|  | int | response_id |
| ) |  |  |

Add an activatable widget to the action area of a Gtk::InfoBar, connecting a signal handler that will emit the Gtk::InfoBar::response signal on the message area when the widget is activated.

The widget is appended to the end of the message areas action area.

Since gtkmm 2.18:

Parameters:

  | child | An activatable widget.
  | response_id | Response ID for child.

Button* Gtk::InfoBar::add_button | ( | const Gtk::StockID& | stock_id,
|  | int | response_id |
| ) |  |  |

Adds a button with the given text (or a stock button, if button_text is a stock ID) and sets things up so that clicking the button will emit the "response" signal with the given response_id.

The button is appended to the end of the info bars's action area. The button widget is returned, but usually you don't need it.

Parameters:

  | button_text | Text of button, or stock ID.
  | response_id | Response ID for the button.

Returns:
  The button widget that was added

Since gtkmm 2.18:

Button* Gtk::InfoBar::add_button | ( | const Glib::ustring & | button_text,
|  | int | response_id |
| ) |  |  |

Adds a button with the given text (or a stock button, if button_text is a stock ID) and sets things up so that clicking the button will emit the "response" signal with the given response_id.

The button is appended to the end of the info bars's action area. The button widget is returned, but usually you don't need it.

Parameters:

  | button_text | Text of button, or stock ID.
  | response_id | Response ID for the button.

Returns:
  The button widget that was added

Since gtkmm 2.18:

const Widget* Gtk::InfoBar::get_action_area | ( |  | ) | const

Returns: the action area.

Returns:
  The action area.

Since gtkmm 2.18:

Widget* Gtk::InfoBar::get_action_area | ( |  | ) |

Returns: the action area.

Returns:
  The action area.

Since gtkmm 2.18:

const Widget* Gtk::InfoBar::get_content_area | ( |  | ) | const

Returns: the content area.

Returns:
  The content area.

Since gtkmm 2.18:

Widget* Gtk::InfoBar::get_content_area | ( |  | ) |

Returns: the content area.

Returns:
  The content area.

Since gtkmm 2.18:

MessageType Gtk::InfoBar::get_message_type | ( |  | ) | const

Returns: the message type of the message area.

Returns:
  The message type of the message area.

Since gtkmm 2.18:

const GtkInfoBar* Gtk::InfoBar::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::HBox.

GtkInfoBar* Gtk::InfoBar::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::HBox.

virtual void Gtk::InfoBar::on_response | ( | int | response_id | ) | `[protected, virtual]`

Glib::PropertyProxy_ReadOnly<MessageType> Gtk::InfoBar::property_message_type | ( |  | ) | const

The type of message.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<MessageType> Gtk::InfoBar::property_message_type | ( |  | ) |

The type of message.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

void Gtk::InfoBar::response | ( | int | response_id | ) |

Emits the 'response' signal with the given response_id.

Since gtkmm 2.18:

Parameters:

  | response_id | A response ID.

void Gtk::InfoBar::set_default_response | ( | int | response_id | ) |

Sets the last widget in the info bar's action area with the given response_id as the default widget for the dialog.

Pressing "Enter" normally activates the default widget.

Since gtkmm 2.18:

Parameters:

  | response_id | A response ID.

void Gtk::InfoBar::set_message_type | ( | MessageType | message_type | ) |

Sets the message type of the message area.

GTK+ uses this type to determine what color to use when drawing the message area.

Since gtkmm 2.18:

Parameters:

  | message_type | A Gtk::MessageType.

void Gtk::InfoBar::set_response_sensitive | ( | int | response_id,
|  | bool | setting = `true` |
| ) |  |  |

Calls gtk_widget_set_sensitive (widget, setting) for each widget in the info bars's action area with the given response_id.

A convenient way to sensitize/desensitize dialog buttons.

Since gtkmm 2.18:

Parameters:

  | response_id | A response ID.
  | setting | `true` for sensitive.

Glib::SignalProxy1< void,int > Gtk::InfoBar::signal_response | ( |  | ) |

Prototype:
  `void on_my_response(int response_id)`

## Friends And Related Function Documentation

Gtk::InfoBar* wrap | ( | GtkInfoBar * | object,
|  | bool | take_copy = `false` |
| ) |  |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  | object | The C instance.
  | take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- gtkmm/infobar.h