ScaleProtocol
public protocol ScaleProtocol : RangeProtocolA GtkScale 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, [classGtkRange], in addition to the methods for GtkScale itself.
To set the value of a scale, you would normally use [methodGtk.Range.set_value].
To detect changes to the value, you would normally use the
[signalGtk.Range::value-changed] signal.
Note that using the same upper and lower bounds for the GtkScale (through
the GtkRange 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).
GtkScale as GtkBuildable
GtkScale supports a custom <marks> element, which can contain multiple
<mark> elements. The “value” and “position” attributes have the same
meaning as [methodGtk.Scale.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]
├── [value][.top][.right][.bottom][.left]
├── marks.top
│   ├── mark
│   ┊    ├── [label]
│   ┊    ╰── indicator
┊   ┊
│   ╰── mark
├── marks.bottom
│   ├── mark
│   ┊    ├── indicator
│   ┊    ╰── [label]
┊   ┊
│   ╰── mark
╰── trough
    ├── [fill]
    ├── [highlight]
    ╰── slider
GtkScale 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 [methodGtk.Scale.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 [methodGtk.Range.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 trough 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 [propertyGtk.Scale:draw-value]),
there is subnode with name value. This node will get the .top or .bottom style
classes similar to the marks node.
Accessibility
GtkScale uses the GTK_ACCESSIBLE_ROLE_SLIDER role.
The ScaleProtocol protocol exposes the methods and properties of an underlying GtkScale instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see Scale.
Alternatively, use ScaleRef as a lighweight, unowned reference if you already have an instance you just want to use.
- 
                  
                  Untyped pointer to the underlying GtkScaleinstance.DeclarationSwift var ptr: UnsafeMutableRawPointer! { get }
- 
                  scale_ptrDefault implementationTyped pointer to the underlying GtkScaleinstance.Default ImplementationReturn the stored, untyped pointer as a typed pointer to the GtkScaleinstance.DeclarationSwift var scale_ptr: UnsafeMutablePointer<GtkScale>! { get }
- 
                  
                  Required Initialiser for types conforming to ScaleProtocolDeclarationSwift init(raw: UnsafeMutableRawPointer)
- 
                  bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a ScalePropertyNamesource property to a given target object.DeclarationSwift @discardableResult @inlinable func bind<Q, T>(property source_property: ScalePropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocolParameterssource_propertythe source property to bind targetthe target object to bind to target_propertythe target property to bind to flagsthe flags to pass to the Bindingtransform_fromValueTransformerto use for forward transformationtransform_toValueTransformerto use for backwards transformationReturn Valuebinding reference or nilin case of an error
- 
                  get(property:Extension method) Get the value of a Scale property DeclarationSwift @inlinable func get(property: ScalePropertyName) -> GLibObject.ValueParameterspropertythe property to get the value for Return Valuethe value of the named property 
- 
                  set(property:Extension methodvalue: ) Set the value of a Scale property. Note that this will only have an effect on properties that are writable and not construct-only! DeclarationSwift @inlinable func set(property: ScalePropertyName, value v: GLibObject.Value)Parameterspropertythe property to get the value for Return Valuethe value of the named property 
- 
                  addMark(value:Extension methodposition: markup: ) Adds a mark at value.A mark is indicated visually by drawing a tick mark next to the scale, and GTK makes it easy for the user to position the scale exactly at the marks value. If markupis notnil, text is shown next to the tick mark.To remove marks from a scale, use [method Gtk.Scale.clear_marks].DeclarationSwift @inlinable func addMark(value: CDouble, position: GtkPositionType, markup: UnsafePointer<CChar>? = nil)
- 
                  clearMarks()Extension methodRemoves any marks that have been added. DeclarationSwift @inlinable func clearMarks()
- 
                  getDigits()Extension methodGets the number of decimal places that are displayed in the value. DeclarationSwift @inlinable func getDigits() -> Int
- 
                  getDrawValue()Extension methodReturns whether the current value is displayed as a string next to the slider. DeclarationSwift @inlinable func getDrawValue() -> Bool
- 
                  getHasOrigin()Extension methodReturns whether the scale has an origin. DeclarationSwift @inlinable func getHasOrigin() -> Bool
- 
                  getLayout()Extension methodGets the PangoLayoutused to display the scale.The returned object is owned by the scale so does not need to be freed by the caller. DeclarationSwift @inlinable func getLayout() -> Pango.LayoutRef!
- 
                  getLayoutOffsets(x:Extension methody: ) Obtains the coordinates where the scale will draw the PangoLayoutrepresenting the text in the scale.Remember when using the PangoLayoutfunction you need to convert to and from pixels usingPANGO_PIXELS()orPANGO_SCALE.If the [property GtkScale:draw-value] property isfalse, the return values are undefined.DeclarationSwift @inlinable func getLayoutOffsets(x: UnsafeMutablePointer<gint>! = nil, y: UnsafeMutablePointer<gint>! = nil)
- 
                  getValuePos()Extension methodGets the position in which the current value is displayed. DeclarationSwift @inlinable func getValuePos() -> GtkPositionType
- 
                  set(digits:Extension method) Sets the number of decimal places that are displayed in the value. Also causes the value of the adjustment to be rounded to this number of digits, so the retrieved value matches the displayed one, if [property GtkScale:draw-value] istruewhen the value changes. If you want to enforce rounding the value when [propertyGtkScale:draw-value] isfalse, you can set [propertyGtkRange:round-digits] instead.Note that rounding to a small number of digits can interfere with the smooth autoscrolling that is built into GtkScale. As an alternative, you can use [methodGtk.Scale.set_format_value_func] to format the displayed value yourself.DeclarationSwift @inlinable func set(digits: Int)
- 
                  set(drawValue:Extension method) Specifies whether the current value is displayed as a string next to the slider. DeclarationSwift @inlinable func set(drawValue: Bool)
- 
                  setFormatValueFunc(func:Extension methoduserData: destroyNotify: ) funcallows you to change how the scale value is displayed.The given function will return an allocated string representing value. That string will then be used to display the scale’s value.If NULLis passed asfunc, the value will be displayed on its own, rounded according to the value of the [propertyGtkScale:digits] property.DeclarationSwift @inlinable func setFormatValueFunc(func: GtkScaleFormatValueFunc? = nil, userData: gpointer! = nil, destroyNotify: GDestroyNotify? = nil)
- 
                  set(hasOrigin:Extension method) Sets whether the scale has an origin. If [property GtkScale:has-origin] is set totrue(the default), the scale will highlight the part of the trough between the origin (bottom or left side) and the current value.DeclarationSwift @inlinable func set(hasOrigin: Bool)
- 
                  setValue(pos:Extension method) Sets the position in which the current value is displayed. DeclarationSwift @inlinable func setValue(pos: GtkPositionType)
- 
                  digitsExtension methodThe number of decimal places that are displayed in the value. DeclarationSwift @inlinable var digits: Int { get nonmutating set }
- 
                  drawValueExtension methodReturns whether the current value is displayed as a string next to the slider. DeclarationSwift @inlinable var drawValue: Bool { get nonmutating set }
- 
                  hasOriginExtension methodReturns whether the scale has an origin. DeclarationSwift @inlinable var hasOrigin: Bool { get nonmutating set }
- 
                  layoutExtension methodGets the PangoLayoutused to display the scale.The returned object is owned by the scale so does not need to be freed by the caller. DeclarationSwift @inlinable var layout: Pango.LayoutRef! { get }
- 
                  valuePosExtension methodGets the position in which the current value is displayed. DeclarationSwift @inlinable var valuePos: GtkPositionType { get nonmutating set }
- 
                  parentInstanceExtension methodUndocumented DeclarationSwift @inlinable var parentInstance: GtkRange { get }
 View on GitHub
            View on GitHub
           Install in Dash
            Install in Dash
           ScaleProtocol Protocol Reference
      ScaleProtocol Protocol Reference