[]Struct gtk::Scale

pub struct Scale(_, _);

A Scale is a slider control used to select a numeric value. To use it, you’ll probably want to investigate the methods on its base class, Range, in addition to the methods for Scale itself. To set the value of a scale, you would normally use RangeExt::set_value. To detect changes to the value, you would normally use the Range::value-changed signal.

Note that using the same upper and lower bounds for the Scale (through the Range methods) will hide the slider itself. This is useful for applications that want to show an undeterminate value on the scale, without changing the layout of the application (such as movie or music players).

Scale as Buildable

Scale supports a custom <marks> element, which can contain multiple <mark> elements. The “value” and “position” attributes have the same meaning as ScaleExt::add_mark parameters of the same name. If the element is not empty, its content is taken as the markup to show at the mark. It can be translated with the usual ”translatable” and “context” attributes.

CSS nodes

scale[.fine-tune][.marks-before][.marks-after]
├── marks.top
│   ├── mark
│   ┊    ├── [label]
│   ┊    ╰── indicator
┊   ┊
│   ╰── mark
├── [value]
├── contents
│   ╰── trough
│       ├── slider
│       ├── [highlight]
│       ╰── [fill]
╰── marks.bottom
    ├── mark
    ┊    ├── indicator
    ┊    ╰── [label]
    ╰── mark

Scale has a main CSS node with name scale and a subnode for its contents, with subnodes named trough and slider.

The main node gets the style class .fine-tune added when the scale is in 'fine-tuning' mode.

If the scale has an origin (see ScaleExt::set_has_origin), there is a subnode with name highlight below the trough node that is used for rendering the highlighted part of the trough.

If the scale is showing a fill level (see RangeExt::set_show_fill_level), there is a subnode with name fill below the trough node that is used for rendering the filled in part of the trough.

If marks are present, there is a marks subnode before or after the contents node, below which each mark gets a node with name mark. The marks nodes get either the .top or .bottom style class.

The mark node has a subnode named indicator. If the mark has text, it also has a subnode named label. When the mark is either above or left of the scale, the label subnode is the first when present. Otherwise, the indicator subnode is the first.

The main CSS node gets the 'marks-before' and/or 'marks-after' style classes added depending on what marks are present.

If the scale is displaying the value (see Scale:draw-value), there is subnode with name value.

Implements

ScaleExt, RangeExt, WidgetExt, glib::object::ObjectExt, BuildableExt, OrientableExt, WidgetExtManual, BuildableExtManual

Implementations

impl Scale[src]

pub fn new<P: IsA<Adjustment>>(
    orientation: Orientation,
    adjustment: Option<&P>
) -> Scale
[src]

Creates a new Scale.

orientation

the scale’s orientation.

adjustment

the Adjustment which sets the range of the scale, or None to create a new adjustment.

Returns

a new Scale

pub fn with_range(
    orientation: Orientation,
    min: f64,
    max: f64,
    step: f64
) -> Scale
[src]

Trait Implementations

impl Clone for Scale

impl Debug for Scale

impl Display for Scale[src]

impl Eq for Scale

impl Hash for Scale

impl IsA<Buildable> for Scale

impl IsA<Orientable> for Scale

impl IsA<Range> for Scale

impl IsA<Widget> for Scale

impl Ord for Scale

impl<T: ObjectType> PartialEq<T> for Scale

impl<T: ObjectType> PartialOrd<T> for Scale

impl StaticType for Scale

Auto Trait Implementations

impl RefUnwindSafe for Scale

impl !Send for Scale

impl !Sync for Scale

impl Unpin for Scale

impl UnwindSafe for Scale

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 

impl<T> Cast for T where
    T: ObjectType, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType, 

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<Array>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.