[−][src]Trait gtk::SwitchExt
Required methods
fn get_active(&self) -> bool
Gets whether the Switch is in its “on” or “off” state.
Returns
true if the Switch is active, and false otherwise
fn get_state(&self) -> bool
fn set_active(&self, is_active: bool)
Changes the state of self to the desired one.
is_active
true if self should be active, and false otherwise
fn set_state(&self, state: bool)
Sets the underlying state of the Switch.
Normally, this is the same as Switch:active, unless the switch
is set up for delayed state changes. This function is typically
called from a Switch::state-set signal handler.
See Switch::state-set for details.
state
the new state
fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
The ::activate signal on Switch 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)
fn connect_state_set<F: Fn(&Self, bool) -> Inhibit + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
The ::state-set signal on Switch 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 Switch:active
property.
To implement delayed state change, applications can connect to this signal,
initiate the change of the underlying state, and call SwitchExt::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 Switch: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_property_active_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_state_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
Implementors
impl<O: IsA<Switch>> SwitchExt for O[src]
fn get_active(&self) -> bool[src]
fn get_state(&self) -> bool[src]
fn set_active(&self, is_active: bool)[src]
fn set_state(&self, state: bool)[src]
fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId[src]
fn emit_activate(&self)[src]
fn connect_state_set<F: Fn(&Self, bool) -> Inhibit + 'static>(
&self,
f: F
) -> SignalHandlerId[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_active_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_state_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId[src]
&self,
f: F
) -> SignalHandlerId