Trait gtk4::prelude::CheckButtonExt
source · pub trait CheckButtonExt: 'static {
Show 17 methods
// Required methods
fn is_active(&self) -> bool;
fn is_inconsistent(&self) -> bool;
fn label(&self) -> Option<GString>;
fn uses_underline(&self) -> bool;
fn set_active(&self, setting: bool);
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_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
Required Methods§
sourcefn is_inconsistent(&self) -> bool
fn is_inconsistent(&self) -> bool
sourcefn uses_underline(&self) -> bool
fn uses_underline(&self) -> bool
Returns whether underlines in the label indicate mnemonics.
Returns
The value of the property::CheckButton::use-underline
property.
See set_use_underline()
for details on how to set
a new value.
sourcefn set_active(&self, setting: bool)
fn set_active(&self, setting: bool)
sourcefn set_group(&self, group: Option<&impl IsA<CheckButton>>)
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
sourcefn set_inconsistent(&self, inconsistent: bool)
fn set_inconsistent(&self, inconsistent: bool)
Sets the CheckButton
to inconsistent state.
You shoud 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
sourcefn set_label(&self, label: Option<&str>)
fn set_label(&self, label: Option<&str>)
Sets the text of @self.
If property::CheckButton::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
sourcefn set_use_underline(&self, setting: bool)
fn set_use_underline(&self, setting: bool)
sourcefn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
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
signal::CheckButton::toggled
signal.
sourcefn emit_activate(&self)
fn emit_activate(&self)
v4_2
only.sourcefn connect_toggled<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_toggled<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
Emitted when the buttons’s property::CheckButton::active
property changes.