Skip to main content

ToggleButtonExt

Trait ToggleButtonExt 

Source
pub trait ToggleButtonExt: IsA<ToggleButton> + 'static {
Show 13 methods // Provided methods fn is_active(&self) -> bool { ... } fn is_inconsistent(&self) -> bool { ... } fn is_mode(&self) -> bool { ... } fn set_active(&self, is_active: bool) { ... } fn set_inconsistent(&self, setting: bool) { ... } fn set_mode(&self, draw_indicator: bool) { ... } fn toggled(&self) { ... } fn draws_indicator(&self) -> bool { ... } fn set_draw_indicator(&self, draw_indicator: bool) { ... } 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_draw_indicator_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_inconsistent_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all ToggleButton methods.

§Implementors

CheckButton, MenuButton, ToggleButton

Provided Methods§

Source

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

a gboolean value.

Source

fn is_inconsistent(&self) -> bool

Gets the value set by set_inconsistent().

§Returns

true if the button is displayed as inconsistent, false otherwise

Source

fn is_mode(&self) -> bool

Retrieves whether the button is displayed as a separate indicator and label. See set_mode().

§Returns

true if the togglebutton is drawn as a separate indicator and label.

Source

fn set_active(&self, is_active: bool)

Sets the status of the toggle button. Set to true if you want the GtkToggleButton to be “pressed in”, and false to raise it. This action causes the toggled signal and the clicked signal to be emitted.

§is_active

true or false.

Source

fn set_inconsistent(&self, setting: bool)

If the user has selected a range of elements (such as some text or spreadsheet cells) that are affected by a toggle button, and the current values in that range are inconsistent, you may want to display the toggle in an “in between” state. This function turns on “in between” display. Normally you would turn off the inconsistent state again if the user toggles the toggle button. This has to be done manually, set_inconsistent() only affects visual appearance, it doesn’t affect the semantics of the button.

§setting

true if state is inconsistent

Source

fn set_mode(&self, draw_indicator: bool)

Sets whether the button is displayed as a separate indicator and label. You can call this function on a checkbutton or a radiobutton with draw_indicator = false to make the button look like a normal button.

This can be used to create linked strip of buttons that work like a StackSwitcher.

This function only affects instances of classes like CheckButton and RadioButton that derive from ToggleButton, not instances of ToggleButton itself.

§draw_indicator

if true, draw the button as a separate indicator and label; if false, draw the button like a normal button

Source

fn toggled(&self)

Emits the toggled signal on the ToggleButton. There is no good reason for an application ever to call this function.

Source

fn draws_indicator(&self) -> bool

Source

fn set_draw_indicator(&self, draw_indicator: bool)

Source

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

Should be connected if you wish to perform an action whenever the ToggleButton’s state is changed.

Source

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

Source

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

Source

fn connect_inconsistent_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§