[]Struct gtk::InfoBar

pub struct InfoBar(_, _);

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

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

Similar to MessageDialog, the contents of a InfoBar can by classified as error message, warning, informational message, etc, by using InfoBarExt::set_message_type. GTK+ may use the message type to determine how the message is displayed.

A simple example for using a InfoBar:

GtkWidget *widget, *message_label, *content_area;
GtkWidget *grid;
GtkInfoBar *bar;

// set up info bar
widget = gtk_info_bar_new ();
bar = GTK_INFO_BAR (widget);
grid = gtk_grid_new ();

gtk_widget_set_no_show_all (widget, TRUE);
message_label = gtk_label_new ("");
content_area = gtk_info_bar_get_content_area (bar);
gtk_container_add (GTK_CONTAINER (content_area),
                   message_label);
gtk_info_bar_add_button (bar,
                         _("_OK"),
                         GTK_RESPONSE_OK);
g_signal_connect (bar,
                  "response",
                  G_CALLBACK (gtk_widget_hide),
                  NULL);
gtk_grid_attach (GTK_GRID (grid),
                 widget,
                 0, 2, 1, 1);

// ...

// show an error message
gtk_label_set_text (GTK_LABEL (message_label), "An error occurred!");
gtk_info_bar_set_message_type (bar,
                               GTK_MESSAGE_ERROR);
gtk_widget_show (bar);

InfoBar as Buildable

The InfoBar implementation of the Buildable interface exposes the content area and action area as internal children with the names “content_area” and “action_area”.

InfoBar supports a custom <action-widgets> element, which can contain multiple <action-widget> 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).

CSS nodes

InfoBar has a single CSS node with name infobar. The node may get one of the style classes .info, .warning, .error or .question, depending on the message type.

Implements

InfoBarExt, BoxExt, ContainerExt, WidgetExt, glib::object::ObjectExt, BuildableExt, OrientableExt, WidgetExtManual, BuildableExtManual

Implementations

impl InfoBar[src]

pub fn new() -> InfoBar[src]

Creates a new InfoBar object.

Returns

a new InfoBar object

Trait Implementations

impl Clone for InfoBar

impl Debug for InfoBar

impl Default for InfoBar[src]

impl Display for InfoBar[src]

impl Eq for InfoBar

impl Hash for InfoBar

impl IsA<Box> for InfoBar

impl IsA<Buildable> for InfoBar

impl IsA<Container> for InfoBar

impl IsA<Orientable> for InfoBar

impl IsA<Widget> for InfoBar

impl Ord for InfoBar

impl<T: ObjectType> PartialEq<T> for InfoBar

impl<T: ObjectType> PartialOrd<T> for InfoBar

impl StaticType for InfoBar

Auto Trait Implementations

impl RefUnwindSafe for InfoBar

impl !Send for InfoBar

impl !Sync for InfoBar

impl Unpin for InfoBar

impl UnwindSafe for InfoBar

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 

impl<T> Cast for T where
    T: ObjectType, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType, 

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<Array>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.