Trait gtk::prelude::ToggleButtonExt[][src]

pub trait ToggleButtonExt: 'static {
Show 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

Required methods

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.

Gets the value set by set_inconsistent().

Returns

true if the button is displayed as inconsistent, false otherwise

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.

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 signal::ToggleButton::toggled signal and the signal::Button::clicked signal to be emitted.

is_active

true or false.

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

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

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

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

Implementors