Trait gtk::prelude::InfoBarExt
source · [−]pub trait InfoBarExt: 'static {
Show 19 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
Required Methods
fn add_action_widget(&self, child: &impl IsA<Widget>, response_id: ResponseType)
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 signal::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.
child
an activatable widget
response_id
response ID for child
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
fn action_area(&self) -> Option<Box>
fn action_area(&self) -> Option<Box>
fn content_area(&self) -> Box
fn content_area(&self) -> Box
fn message_type(&self) -> MessageType
fn message_type(&self) -> MessageType
fn is_revealed(&self) -> bool
fn is_revealed(&self) -> bool
v3_22_29
only.Returns
the current value of the GtkInfoBar:revealed property.
fn response(&self, response_id: ResponseType)
fn response(&self, response_id: ResponseType)
fn set_default_response(&self, response_id: ResponseType)
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
fn set_message_type(&self, message_type: MessageType)
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
fn set_response_sensitive(&self, response_id: ResponseType, setting: bool)
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
fn set_revealed(&self, revealed: bool)
fn set_revealed(&self, revealed: bool)
v3_22_29
only.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
If true, a standard close button is shown. When clicked it emits
the response ResponseType::Close
.
setting
true
to include a close button
fn connect_close<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
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.
fn emit_close(&self)
fn connect_response<F: Fn(&Self, ResponseType) + 'static>(
&self,
f: F
) -> SignalHandlerId
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
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_revealed_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
v3_22_29
only.