Trait gtk::prelude::SpinButtonExt
source · [−]pub trait SpinButtonExt: 'static {
Show 32 methods
fn configure(
&self,
adjustment: Option<&impl IsA<Adjustment>>,
climb_rate: f64,
digits: u32
);
fn adjustment(&self) -> Adjustment;
fn digits(&self) -> u32;
fn increments(&self) -> (f64, f64);
fn is_numeric(&self) -> bool;
fn range(&self) -> (f64, f64);
fn snaps_to_ticks(&self) -> bool;
fn update_policy(&self) -> SpinButtonUpdatePolicy;
fn value(&self) -> f64;
fn value_as_int(&self) -> i32;
fn wraps(&self) -> bool;
fn set_adjustment(&self, adjustment: &impl IsA<Adjustment>);
fn set_digits(&self, digits: u32);
fn set_increments(&self, step: f64, page: f64);
fn set_numeric(&self, numeric: bool);
fn set_range(&self, min: f64, max: f64);
fn set_snap_to_ticks(&self, snap_to_ticks: bool);
fn set_update_policy(&self, policy: SpinButtonUpdatePolicy);
fn set_value(&self, value: f64);
fn set_wrap(&self, wrap: bool);
fn spin(&self, direction: SpinType, increment: f64);
fn update(&self);
fn climb_rate(&self) -> f64;
fn set_climb_rate(&self, climb_rate: f64);
fn connect_adjustment_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_climb_rate_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_digits_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_numeric_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_snap_to_ticks_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_update_policy_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_value_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_wrap_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
}Expand description
Required Methods
Changes the properties of an existing spin button. The adjustment, climb rate, and number of decimal places are updated accordingly.
adjustment
a Adjustment to replace the spin button’s
existing adjustment, or None to leave its current adjustment unchanged
climb_rate
the new climb rate
digits
the number of decimal places to display in the spin button
fn adjustment(&self) -> Adjustment
fn adjustment(&self) -> Adjustment
fn is_numeric(&self) -> bool
fn is_numeric(&self) -> bool
Returns whether non-numeric text can be typed into the spin button.
See set_numeric().
Returns
true if only numeric text can be entered
fn snaps_to_ticks(&self) -> bool
fn snaps_to_ticks(&self) -> bool
Returns whether the values are corrected to the nearest step.
See set_snap_to_ticks().
Returns
true if values are snapped to the nearest step
fn update_policy(&self) -> SpinButtonUpdatePolicy
fn update_policy(&self) -> SpinButtonUpdatePolicy
Gets the update behavior of a spin button.
See set_update_policy().
Returns
the current update policy
fn value_as_int(&self) -> i32
fn value_as_int(&self) -> i32
Returns whether the spin button’s value wraps around to the
opposite limit when the upper or lower limit of the range is
exceeded. See set_wrap().
Returns
true if the spin button wraps around
fn set_adjustment(&self, adjustment: &impl IsA<Adjustment>)
fn set_adjustment(&self, adjustment: &impl IsA<Adjustment>)
Replaces the Adjustment associated with self.
adjustment
a Adjustment to replace the existing adjustment
fn set_digits(&self, digits: u32)
fn set_digits(&self, digits: u32)
Set the precision to be displayed by self. Up to 20 digit precision
is allowed.
digits
the number of digits after the decimal point to be displayed for the spin button’s value
fn set_increments(&self, step: f64, page: f64)
fn set_increments(&self, step: f64, page: f64)
fn set_numeric(&self, numeric: bool)
fn set_numeric(&self, numeric: bool)
Sets the flag that determines if non-numeric text can be typed into the spin button.
numeric
flag indicating if only numeric entry is allowed
fn set_snap_to_ticks(&self, snap_to_ticks: bool)
fn set_snap_to_ticks(&self, snap_to_ticks: bool)
Sets the policy as to whether values are corrected to the nearest step increment when a spin button is activated after providing an invalid value.
snap_to_ticks
a flag indicating if invalid values should be corrected
fn set_update_policy(&self, policy: SpinButtonUpdatePolicy)
fn set_update_policy(&self, policy: SpinButtonUpdatePolicy)
Sets the update behavior of a spin button. This determines whether the spin button is always updated or only when a valid value is set.
policy
a SpinButtonUpdatePolicy value
Sets the flag that determines if a spin button value wraps around to the opposite limit when the upper or lower limit of the range is exceeded.
wrap
a flag indicating if wrapping behavior is performed