W Wrapl, The Programming Language

Libraries:Gtk:Gtk:Scale

Types

T

Inherits from:

A T 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.Gtk.Range.T, in addition to the methods for T itself. To set the value of a scale, you would normally use Gtk.Gtk.Range.SetValue. To detect changes to the value, you would normally use the "value_changed" signal.

The T widget is an abstract class, used only for deriving the subclasses Gtk.Gtk.HScale.T and Gtk.Gtk.VScale.T. To create a scale widget, call gtk_hscale_new_with_range() or gtk_vscale_new_with_range().

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 AddMark 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.



Constants

Nil : T

Functions

GetType() : Gtk.GObject.Type.T



Methods

:AddMark(self @ T, value @ Std.Real.T, position @ Gtk.Gtk.PositionType.T, markup @ Std.String.T) : Std.Object.T

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 markup is not NULL, text is shown next to the tick mark.

To remove marks from a scale, use ClearMarks.

scale a T
value the value at which the mark is placed, must be between the lower and upper limits of the scales' adjustment
position where to draw the mark. For a horizontal scale, Gtk.Gtk.PositionType.Top is drawn above the scale, anything else below. For a vertical scale, Gtk.Gtk.PositionType.Left is drawn to the left of the scale, anything else to the right.
markup Text to be shown at the mark, using Pango markup, or NULL. [allow-none]


:ClearMarks(self @ T) : Std.Object.T

Removes any marks that have been added with AddMark.

scale a T


:GetDigits(self @ T) : Std.Integer.SmallT

Gets the number of decimal places that are displayed in the value.

scale a T
Returns the number of decimal places that are displayed


:GetDrawValue(self @ T) : Std.Symbol.T

Returns whether the current value is displayed as a string next to the slider.

scale a T
Returns whether the current value is displayed as a string


:GetLayout(self @ T) : Gtk.Pango.Layout.T

Gets the PangoLayout used to display the scale. The returned object is owned by the scale so does not need to be freed by the caller.

scale A T
Returns the PangoLayout for this scale, or NULL if the "draw-value" property is FALSE. [transfer none]


:GetLayoutOffsets(self @ T, x @ Std.Object.T, y @ Std.Object.T) : Std.Object.T

Obtains the coordinates where the scale will draw the PangoLayout representing the text in the scale. Remember when using the PangoLayout function you need to convert to and from pixels using PANGO_PIXELS() or PANGO_SCALE.

If the "draw-value" property is FALSE, the return values are undefined.

scale a T
x location to store X offset of layout, or NULL. [out][allow-none]
y location to store Y offset of layout, or NULL. [out][allow-none]


:GetValuePos(self @ T) : Gtk.Gtk.PositionType.T

Gets the position in which the current value is displayed.

scale a T
Returns the position in which the current value is displayed


:SetDigits(self @ T, digits @ Std.Integer.SmallT) : Std.Object.T

Sets the number of decimal places that are displayed in the value. Also causes the value of the adjustment to be rounded off to this number of digits, so the retrieved value matches the value the user saw.

scale a T
digits the number of decimal places to display, e.g. use 1 to display 1.0, 2 to display 1.00, etc


:SetDrawValue(self @ T, draw_value @ Std.Symbol.T) : Std.Object.T

Specifies whether the current value is displayed as a string next to the slider.

scale a T
draw_value TRUE to draw the value


:SetValuePos(self @ T, pos @ Gtk.Gtk.PositionType.T) : Std.Object.T

Sets the position in which the current value is displayed.

scale a T
pos the position in which the current value is displayed