pub trait ToggleButtonExt: IsA<ToggleButton> + 'static {
// Provided methods
fn is_active(&self) -> bool { ... }
fn set_active(&self, is_active: bool) { ... }
fn set_group(&self, group: Option<&impl IsA<ToggleButton>>) { ... }
fn toggled(&self) { ... }
fn connect_toggled<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... }
fn connect_active_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_group_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}
Expand description
Provided Methods§
Sourcefn is_active(&self) -> bool
fn is_active(&self) -> bool
Queries a ToggleButton
and returns its current state.
Returns true
if the toggle button is pressed in and false
if it is raised.
§Returns
whether the button is pressed
Sourcefn set_active(&self, is_active: bool)
fn set_active(&self, is_active: bool)
Sourcefn set_group(&self, group: Option<&impl IsA<ToggleButton>>)
fn set_group(&self, group: Option<&impl IsA<ToggleButton>>)
Adds @self_ to the group of @group.
In a group of multiple toggle buttons, only one button can be active at a time.
Setting up groups in a cycle leads to undefined behavior.
Note that the same effect can be achieved via the Actionable
API, by using the same action with parameter type and state type ‘s’
for all buttons in the group, and giving each button its own target
value.
§group
another ToggleButton
to
form a group with
Sourcefn toggled(&self)
👎Deprecated: Since 4.10
fn toggled(&self)
Emits the ::toggled signal on the ToggleButton
.
§Deprecated since 4.10
There is no good reason for an application ever to call this function.
Sourcefn connect_toggled<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_toggled<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
Emitted whenever the ToggleButton
’s state is changed.
fn connect_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_group_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", so this trait is not object safe.