gtkmm: Gtk::InfoBar Class Reference

gtkmm 3.4.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Related Functions
Gtk::InfoBar Class Reference
Widgets

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

Inheritance 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 of info_bar.
const Widget* | get_action_area () const
| Returns the action area of info_bar.
Widget* | get_content_area ()
| Returns the content area of info_bar.
const Widget* | get_content_area () const
| Returns the content area of info_bar.
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::signal_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)
| This is a default handler for the signal signal_response().
## 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::signal_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 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.

Since gtkmm 2.18:

Parameters:

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

Returns:
  The Gtk::Button widget that was added.

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.

Since gtkmm 2.18:

Parameters:

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

Returns:
  The Gtk::Button widget that was added.

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

Returns the action area of info_bar.

Since gtkmm 2.18:

Returns:
  The action area.

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

Returns the action area of info_bar.

Since gtkmm 2.18:

Returns:
  The action area.

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

Returns the content area of info_bar.

Since gtkmm 2.18:

Returns:
  The content area.

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

Returns the content area of info_bar.

Since gtkmm 2.18:

Returns:
  The content area.

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

Returns the message type of the message area.

Since gtkmm 2.18:

Returns:
  The message type of the message area.

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

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::HBox.

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

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::HBox.

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

This is a default handler for the signal signal_response().

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.

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.

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.

Note that this function currently requires info_bar to be added to a widget hierarchy.

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

Slot Prototype:
  `void on_my_response(int response_id)`

Emitted when an action widget is clicked or the application programmer calls Gtk::Dialog::response(). The response_id depends on which action widget was clicked.

Since gtkmm 2.18:

Parameters:

  response_id | The 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