Trait gtk4::prelude::CheckButtonExt

source ·
pub trait CheckButtonExt: IsA<CheckButton> + Sealed + 'static {
Show 20 methods // Provided methods fn is_active(&self) -> bool { ... } fn child(&self) -> Option<Widget> { ... } fn is_inconsistent(&self) -> bool { ... } fn label(&self) -> Option<GString> { ... } fn uses_underline(&self) -> bool { ... } fn set_active(&self, setting: bool) { ... } fn set_child(&self, child: Option<&impl IsA<Widget>>) { ... } fn set_group(&self, group: Option<&impl IsA<CheckButton>>) { ... } fn set_inconsistent(&self, inconsistent: bool) { ... } fn set_label(&self, label: Option<&str>) { ... } fn set_use_underline(&self, setting: bool) { ... } fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... } fn emit_activate(&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_child_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_group_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_inconsistent_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_label_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_use_underline_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all CheckButton methods.

§Implementors

CheckButton

Provided Methods§

source

fn is_active(&self) -> bool

Returns whether the check button is active.

§Returns

whether the check button is active

source

fn child(&self) -> Option<Widget>

Available on crate feature v4_8 only.

Gets the child widget of @self or NULL if label is set.

§Returns

the child widget of @self

source

fn is_inconsistent(&self) -> bool

Returns whether the check button is in an inconsistent state.

§Returns

true if @self is currently in an inconsistent state

source

fn label(&self) -> Option<GString>

Returns the label of the check button or NULL if child is set.

§Returns

The label @self shows next to the indicator. If no label is shown, None will be returned.

source

fn uses_underline(&self) -> bool

Returns whether underlines in the label indicate mnemonics.

§Returns

The value of the use-underline property. See set_use_underline() for details on how to set a new value.

source

fn set_active(&self, setting: bool)

Changes the check buttons active state.

§setting

the new value to set

source

fn set_child(&self, child: Option<&impl IsA<Widget>>)

Available on crate feature v4_8 only.

Sets the child widget of @self.

Note that by using this API, you take full responsibility for setting up the proper accessibility label and description information for @self. Most likely, you’ll either set the accessibility label or description for @self explicitly, or you’ll set a labelled-by or described-by relations from @child to @self.

§child

the child widget

source

fn set_group(&self, group: Option<&impl IsA<CheckButton>>)

Adds @self to the group of @group.

In a group of multiple check buttons, only one button can be active at a time. The behavior of a checkbutton in a group is also commonly known as a radio button.

Setting the group of a check button also changes the css name of the indicator widget’s CSS node to ‘radio’.

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 CheckButton to form a group with

source

fn set_inconsistent(&self, inconsistent: bool)

Sets the CheckButton to inconsistent state.

You should turn off the inconsistent state again if the user checks the check button. This has to be done manually.

§inconsistent

true if state is inconsistent

source

fn set_label(&self, label: Option<&str>)

Sets the text of @self.

If use-underline is true, an underscore in @label is interpreted as mnemonic indicator, see set_use_underline() for details on this behavior.

§label

The text shown next to the indicator, or None to show no text

source

fn set_use_underline(&self, setting: bool)

Sets whether underlines in the label indicate mnemonics.

If @setting is true, an underscore character in @self’s label indicates a mnemonic accelerator key. This behavior is similar to use-underline.

§setting

the new value to set

source

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

Available on crate feature v4_2 only.

Emitted to when the check button is activated.

The ::activate signal on CheckButton is an action signal and emitting it causes the button to animate press then release.

Applications should never connect to this signal, but use the toggled signal.

The default bindings for this signal are all forms of the and Enter keys.

source

fn emit_activate(&self)

Available on crate feature v4_2 only.
source

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

Emitted when the buttons’s active property changes.

source

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

source

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

Available on crate feature v4_8 only.
source

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

source

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

source

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

source

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

Object Safety§

This trait is not object safe.

Implementors§