pub trait SwitchExt: IsA<Switch> + 'static {
// Provided methods
fn is_active(&self) -> bool { ... }
fn state(&self) -> bool { ... }
fn set_active(&self, is_active: bool) { ... }
fn set_state(&self, state: bool) { ... }
fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... }
fn emit_activate(&self) { ... }
fn connect_state_set<F: Fn(&Self, bool) -> Propagation + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_active_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_state_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}Provided Methods§
Sourcefn set_active(&self, is_active: bool)
fn set_active(&self, is_active: bool)
Sourcefn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
The ::activate signal on GtkSwitch is an action signal and emitting it causes the switch to animate. Applications should never connect to this signal, but use the notify::active signal.
fn emit_activate(&self)
Sourcefn connect_state_set<F: Fn(&Self, bool) -> Propagation + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_state_set<F: Fn(&Self, bool) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId
The ::state-set signal on GtkSwitch is emitted to change the underlying
state. It is emitted when the user changes the switch position. The
default handler keeps the state in sync with the active
property.
To implement delayed state change, applications can connect to this signal,
initiate the change of the underlying state, and call set_state()
when the underlying state change is complete. The signal handler should
return true to prevent the default handler from running.
Visually, the underlying state is represented by the trough color of
the switch, while the active property is represented by the
position of the switch.
§state
the new state of the switch
§Returns
true to stop the signal emission
fn connect_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_state_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".