Gtk.Scale
const Gtk = imports.gi.Gtk; let scale = new Gtk.Scale({ digits: value, draw_value: value, has_origin: value, value_pos: value, });
A 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, Gtk.Range, in addition to the methods for GtkScale itself. To set the value of a scale, you would normally use Gtk.Range.prototype.set_value. To detect changes to the value, you would normally use the Gtk.Range::value-changed signal.
Note that using the same upper and lower bounds for the Gtk.Scale (through the Gtk.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).
<refsect2 id="GtkScale-BUILDER-UI"><title>GtkScale as GtkBuildable</title> GtkScale supports a custom <marks> element, which can contain multiple <mark> elements. The "value" and "position" attributes have the same meaning as Gtk.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. </refsect2>
Hierarchy
-
GObject.Object
-
GObject.InitiallyUnowned
-
Gtk.Widget
-
Gtk.Range
- Gtk.Scale
-
-
-
Methods
- Gtk.Scale.prototype.add_mark
- Gtk.Scale.prototype.clear_marks
- Gtk.Scale.prototype.get_digits
- Gtk.Scale.prototype.get_draw_value
- Gtk.Scale.prototype.get_has_origin
- Gtk.Scale.prototype.get_layout
- Gtk.Scale.prototype.get_layout_offsets
- Gtk.Scale.prototype.get_value_pos
- Gtk.Scale.prototype.set_digits
- Gtk.Scale.prototype.set_draw_value
- Gtk.Scale.prototype.set_has_origin
- Gtk.Scale.prototype.set_value_pos