Skip to main content

InfoBarExt

Trait InfoBarExt 

Source
pub trait InfoBarExt:
    IsA<InfoBar>
    + Sealed
    + 'static {
Show 19 methods // Provided methods fn add_action_widget( &self, child: &impl IsA<Widget>, response_id: ResponseType, ) { ... } fn add_button( &self, button_text: &str, response_id: ResponseType, ) -> Option<Button> { ... } fn action_area(&self) -> Option<Box> { ... } fn content_area(&self) -> Box { ... } fn message_type(&self) -> MessageType { ... } fn is_revealed(&self) -> bool { ... } fn shows_close_button(&self) -> bool { ... } fn response(&self, response_id: ResponseType) { ... } fn set_default_response(&self, response_id: ResponseType) { ... } fn set_message_type(&self, message_type: MessageType) { ... } fn set_response_sensitive(&self, response_id: ResponseType, setting: bool) { ... } fn set_revealed(&self, revealed: bool) { ... } fn set_show_close_button(&self, setting: bool) { ... } fn connect_close<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... } fn emit_close(&self) { ... } fn connect_response<F: Fn(&Self, ResponseType) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_message_type_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_revealed_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_show_close_button_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all InfoBar methods.

§Implementors

InfoBar

Provided Methods§

Source

fn add_action_widget(&self, child: &impl IsA<Widget>, response_id: ResponseType)

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

§child

an activatable widget

§response_id

response ID for child

Source

fn add_button( &self, button_text: &str, response_id: ResponseType, ) -> Option<Button>

Adds a button with the given text 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.

§button_text

text of button

§response_id

response ID for the button

§Returns

the Button widget that was added

Source

fn action_area(&self) -> Option<Box>

Returns the action area of self.

§Returns

the action area

Source

fn content_area(&self) -> Box

Returns the content area of self.

§Returns

the content area

Source

fn message_type(&self) -> MessageType

Returns the message type of the message area.

§Returns

the message type of the message area.

Source

fn is_revealed(&self) -> bool

§Returns

the current value of the GtkInfoBar:revealed property.

Source

fn shows_close_button(&self) -> bool

Returns whether the widget will display a standard close button.

§Returns

true if the widget displays standard close button

Source

fn response(&self, response_id: ResponseType)

Emits the “response” signal with the given response_id.

§response_id

a response ID

Source

fn set_default_response(&self, response_id: ResponseType)

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 self to be added to a widget hierarchy.

§response_id

a response ID

Source

fn set_message_type(&self, message_type: MessageType)

Sets the message type of the message area.

GTK+ uses this type to determine how the message is displayed.

§message_type

a MessageType

Source

fn set_response_sensitive(&self, response_id: ResponseType, setting: bool)

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.

§response_id

a response ID

§setting

TRUE for sensitive

Source

fn set_revealed(&self, revealed: bool)

Sets the GtkInfoBar:revealed property to revealed. This will cause self to show up with a slide-in transition.

Note that this property does not automatically show self and thus won’t have any effect if it is invisible.

§revealed

The new value of the property

Source

fn set_show_close_button(&self, setting: bool)

If true, a standard close button is shown. When clicked it emits the response ResponseType::Close.

§setting

true to include a close button

Source

fn connect_close<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

The ::close signal is a [keybinding signal][GtkBindingSignal] which gets emitted when the user uses a keybinding to dismiss the info bar.

The default binding for this signal is the Escape key.

Source

fn emit_close(&self)

Source

fn connect_response<F: Fn(&Self, ResponseType) + 'static>( &self, f: F, ) -> SignalHandlerId

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

§response_id

the response ID

Source

fn connect_message_type_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_revealed_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_show_close_button_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§