[][src]Trait gtk::RangeExt

pub trait RangeExt: 'static {
    fn get_adjustment(&self) -> Adjustment;
fn get_fill_level(&self) -> f64;
fn get_flippable(&self) -> bool;
fn get_inverted(&self) -> bool;
fn get_lower_stepper_sensitivity(&self) -> SensitivityType;
fn get_min_slider_size(&self) -> i32;
fn get_range_rect(&self) -> Rectangle;
fn get_restrict_to_fill_level(&self) -> bool;
fn get_round_digits(&self) -> i32;
fn get_show_fill_level(&self) -> bool;
fn get_slider_range(&self) -> (i32, i32);
fn get_slider_size_fixed(&self) -> bool;
fn get_upper_stepper_sensitivity(&self) -> SensitivityType;
fn get_value(&self) -> f64;
fn set_adjustment<P: IsA<Adjustment>>(&self, adjustment: &P);
fn set_fill_level(&self, fill_level: f64);
fn set_flippable(&self, flippable: bool);
fn set_increments(&self, step: f64, page: f64);
fn set_inverted(&self, setting: bool);
fn set_lower_stepper_sensitivity(&self, sensitivity: SensitivityType);
fn set_min_slider_size(&self, min_size: i32);
fn set_range(&self, min: f64, max: f64);
fn set_restrict_to_fill_level(&self, restrict_to_fill_level: bool);
fn set_round_digits(&self, round_digits: i32);
fn set_show_fill_level(&self, show_fill_level: bool);
fn set_slider_size_fixed(&self, size_fixed: bool);
fn set_upper_stepper_sensitivity(&self, sensitivity: SensitivityType);
fn set_value(&self, value: f64);
fn connect_adjust_bounds<F: Fn(&Self, f64) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_change_value<F: Fn(&Self, ScrollType, f64) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_move_slider<F: Fn(&Self, ScrollType) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn emit_move_slider(&self, step: ScrollType);
fn connect_value_changed<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_adjustment_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_fill_level_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_inverted_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_lower_stepper_sensitivity_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_restrict_to_fill_level_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_round_digits_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_show_fill_level_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_upper_stepper_sensitivity_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; }

Trait containing all Range methods.

Implementors

Range, Scale, Scrollbar

Required methods

fn get_adjustment(&self) -> Adjustment

Get the Adjustment which is the “model” object for Range. See RangeExt::set_adjustment for details. The return value does not have a reference added, so should not be unreferenced.

Returns

a Adjustment

fn get_fill_level(&self) -> f64

Gets the current position of the fill level indicator.

Returns

The current fill level

fn get_flippable(&self) -> bool

Gets the value set by RangeExt::set_flippable.

Returns

true if the range is flippable

fn get_inverted(&self) -> bool

Gets the value set by RangeExt::set_inverted.

Returns

true if the range is inverted

fn get_lower_stepper_sensitivity(&self) -> SensitivityType

Gets the sensitivity policy for the stepper that points to the 'lower' end of the Range’s adjustment.

Returns

The lower stepper’s sensitivity policy.

fn get_min_slider_size(&self) -> i32

This function is useful mainly for Range subclasses.

See RangeExt::set_min_slider_size.

Deprecated since 3.20

Use the min-height/min-width CSS properties on the slider node.

Returns

The minimum size of the range’s slider.

fn get_range_rect(&self) -> Rectangle

This function returns the area that contains the range’s trough and its steppers, in widget->window coordinates.

This function is useful mainly for Range subclasses.

range_rect

return location for the range rectangle

fn get_restrict_to_fill_level(&self) -> bool

Gets whether the range is restricted to the fill level.

Returns

true if self is restricted to the fill level.

fn get_round_digits(&self) -> i32

Gets the number of digits to round the value to when it changes. See Range::change-value.

Returns

the number of digits to round to

fn get_show_fill_level(&self) -> bool

Gets whether the range displays the fill level graphically.

Returns

true if self shows the fill level.

fn get_slider_range(&self) -> (i32, i32)

This function returns sliders range along the long dimension, in widget->window coordinates.

This function is useful mainly for Range subclasses.

slider_start

return location for the slider's start, or None

slider_end

return location for the slider's end, or None

fn get_slider_size_fixed(&self) -> bool

This function is useful mainly for Range subclasses.

See RangeExt::set_slider_size_fixed.

Returns

whether the range’s slider has a fixed size.

fn get_upper_stepper_sensitivity(&self) -> SensitivityType

Gets the sensitivity policy for the stepper that points to the 'upper' end of the Range’s adjustment.

Returns

The upper stepper’s sensitivity policy.

fn get_value(&self) -> f64

Gets the current value of the range.

Returns

current value of the range.

fn set_adjustment<P: IsA<Adjustment>>(&self, adjustment: &P)

Sets the adjustment to be used as the “model” object for this range widget. The adjustment indicates the current range value, the minimum and maximum range values, the step/page increments used for keybindings and scrolling, and the page size. The page size is normally 0 for Scale and nonzero for Scrollbar, and indicates the size of the visible area of the widget being scrolled. The page size affects the size of the scrollbar slider.

adjustment

a Adjustment

fn set_fill_level(&self, fill_level: f64)

Set the new position of the fill level indicator.

The “fill level” is probably best described by its most prominent use case, which is an indicator for the amount of pre-buffering in a streaming media player. In that use case, the value of the range would indicate the current play position, and the fill level would be the position up to which the file/stream has been downloaded.

This amount of prebuffering can be displayed on the range’s trough and is themeable separately from the trough. To enable fill level display, use RangeExt::set_show_fill_level. The range defaults to not showing the fill level.

Additionally, it’s possible to restrict the range’s slider position to values which are smaller than the fill level. This is controller by RangeExt::set_restrict_to_fill_level and is by default enabled.

fill_level

the new position of the fill level indicator

fn set_flippable(&self, flippable: bool)

If a range is flippable, it will switch its direction if it is horizontal and its direction is TextDirection::Rtl.

See WidgetExt::get_direction.

flippable

true to make the range flippable

fn set_increments(&self, step: f64, page: f64)

Sets the step and page sizes for the range. The step size is used when the user clicks the Scrollbar arrows or moves Scale via arrow keys. The page size is used for example when moving via Page Up or Page Down keys.

step

step size

page

page size

fn set_inverted(&self, setting: bool)

Ranges normally move from lower to higher values as the slider moves from top to bottom or left to right. Inverted ranges have higher values at the top or on the right rather than on the bottom or left.

setting

true to invert the range

fn set_lower_stepper_sensitivity(&self, sensitivity: SensitivityType)

Sets the sensitivity policy for the stepper that points to the 'lower' end of the Range’s adjustment.

sensitivity

the lower stepper’s sensitivity policy.

fn set_min_slider_size(&self, min_size: i32)

Sets the minimum size of the range’s slider.

This function is useful mainly for Range subclasses.

Deprecated since 3.20

Use the min-height/min-width CSS properties on the slider node.

min_size

The slider’s minimum size

fn set_range(&self, min: f64, max: f64)

Sets the allowable values in the Range, and clamps the range value to be between min and max. (If the range has a non-zero page size, it is clamped between min and max - page-size.)

min

minimum range value

max

maximum range value

fn set_restrict_to_fill_level(&self, restrict_to_fill_level: bool)

Sets whether the slider is restricted to the fill level. See RangeExt::set_fill_level for a general description of the fill level concept.

restrict_to_fill_level

Whether the fill level restricts slider movement.

fn set_round_digits(&self, round_digits: i32)

Sets the number of digits to round the value to when it changes. See Range::change-value.

round_digits

the precision in digits, or -1

fn set_show_fill_level(&self, show_fill_level: bool)

Sets whether a graphical fill level is show on the trough. See RangeExt::set_fill_level for a general description of the fill level concept.

show_fill_level

Whether a fill level indicator graphics is shown.

fn set_slider_size_fixed(&self, size_fixed: bool)

Sets whether the range’s slider has a fixed size, or a size that depends on its adjustment’s page size.

This function is useful mainly for Range subclasses.

size_fixed

true to make the slider size constant

fn set_upper_stepper_sensitivity(&self, sensitivity: SensitivityType)

Sets the sensitivity policy for the stepper that points to the 'upper' end of the Range’s adjustment.

sensitivity

the upper stepper’s sensitivity policy.

fn set_value(&self, value: f64)

Sets the current value of the range; if the value is outside the minimum or maximum range values, it will be clamped to fit inside them. The range emits the Range::value-changed signal if the value changes.

value

new value of the range

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

Emitted before clamping a value, to give the application a chance to adjust the bounds.

value

the value before we clamp

fn connect_change_value<F: Fn(&Self, ScrollType, f64) -> Inhibit + 'static>(
    &self,
    f: F
) -> SignalHandlerId

The Range::change-value signal is emitted when a scroll action is performed on a range. It allows an application to determine the type of scroll event that occurred and the resultant new value. The application can handle the event itself and return true to prevent further processing. Or, by returning false, it can pass the event to other handlers until the default GTK+ handler is reached.

The value parameter is unrounded. An application that overrides the Range::change-value signal is responsible for clamping the value to the desired number of decimal digits; the default GTK+ handler clamps the value based on Range:round-digits.

scroll

the type of scroll action that was performed

value

the new value resulting from the scroll action

Returns

true to prevent other handlers from being invoked for the signal, false to propagate the signal further

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

Virtual function that moves the slider. Used for keybindings.

step

how to move the slider

fn emit_move_slider(&self, step: ScrollType)

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

Emitted when the range value changes.

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

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

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

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

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

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

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

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

Loading content...

Implementors

impl<O: IsA<Range>> RangeExt for O[src]

Loading content...