<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
<!ENTITY pi "&#960;">
<!ENTITY solidus "&#8260;">
]>
<refentry id="GtkScale">
<refmeta>
<refentrytitle role="top_of_page" id="GtkScale.top_of_page">GtkScale</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkScale</refname>
<refpurpose>A slider widget for selecting a value from a range</refpurpose>
</refnamediv>

<refsect1 id="GtkScale.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="function_type"><link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><phrase role="c_punctuation">(</phrase><link linkend="GtkScaleFormatValueFunc">*GtkScaleFormatValueFunc</link><phrase role="c_punctuation">)</phrase>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-scale-new">gtk_scale_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-scale-new-with-range">gtk_scale_new_with_range</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-scale-set-format-value-func">gtk_scale_set_format_value_func</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-scale-set-digits">gtk_scale_set_digits</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-scale-set-draw-value">gtk_scale_set_draw_value</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-scale-set-has-origin">gtk_scale_set_has_origin</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-scale-set-value-pos">gtk_scale_set_value_pos</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gint"><returnvalue>gint</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-scale-get-digits">gtk_scale_get_digits</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-scale-get-draw-value">gtk_scale_get_draw_value</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-scale-get-has-origin">gtk_scale_get_has_origin</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkPositionType"><returnvalue>GtkPositionType</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-scale-get-value-pos">gtk_scale_get_value_pos</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="PangoLayout"><returnvalue>PangoLayout</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-scale-get-layout">gtk_scale_get_layout</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-scale-get-layout-offsets">gtk_scale_get_layout_offsets</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-scale-add-mark">gtk_scale_add_mark</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-scale-clear-marks">gtk_scale_clear_marks</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkScale.properties" role="properties">
<title role="properties.title">Properties</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="properties_type" colwidth="150px"/>
<colspec colname="properties_name" colwidth="300px"/>
<colspec colname="properties_flags" colwidth="200px"/>
<tbody>
<row><entry role="property_type"><link linkend="gint"><type>gint</type></link></entry><entry role="property_name"><link linkend="GtkScale--digits">digits</link></entry><entry role="property_flags">Read / Write</entry></row>
<row><entry role="property_type"><link linkend="gboolean"><type>gboolean</type></link></entry><entry role="property_name"><link linkend="GtkScale--draw-value">draw-value</link></entry><entry role="property_flags">Read / Write</entry></row>
<row><entry role="property_type"><link linkend="gboolean"><type>gboolean</type></link></entry><entry role="property_name"><link linkend="GtkScale--has-origin">has-origin</link></entry><entry role="property_flags">Read / Write</entry></row>
<row><entry role="property_type"><link linkend="GtkPositionType"><type>GtkPositionType</type></link></entry><entry role="property_name"><link linkend="GtkScale--value-pos">value-pos</link></entry><entry role="property_flags">Read / Write</entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkScale.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="datatype_keyword">struct</entry><entry role="function_name"><link linkend="GtkScale-struct">GtkScale</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkScale.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GObject">GObject</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GInitiallyUnowned">GInitiallyUnowned</link>
        <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GtkWidget">GtkWidget</link>
            <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GtkRange">GtkRange</link>
                <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GtkScale
</screen>
</refsect1>
<refsect1 id="GtkScale.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GtkScale implements
 <link linkend="AtkImplementorIface">AtkImplementorIface</link>,  <link linkend="GtkBuildable">GtkBuildable</link>,  <link linkend="GtkConstraintTarget">GtkConstraintTarget</link> and  <link linkend="GtkOrientable">GtkOrientable</link>.</para>

</refsect1>

<refsect1 id="GtkScale.includes"><title>Includes</title><synopsis>#include &lt;gtk/gtk.h&gt;
</synopsis></refsect1>

<refsect1 id="GtkScale.description" role="desc">
<title role="desc.title">Description</title>
<para>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, <link linkend="GtkRange"><type>GtkRange</type></link>, in addition to the methods for GtkScale itself.
To set the value of a scale, you would normally use <link linkend="gtk-range-set-value"><function>gtk_range_set_value()</function></link>.
To detect changes to the value, you would normally use the
<link linkend="GtkRange-value-changed"><type>“value-changed”</type></link> signal.</para>
<para>Note that using the same upper and lower bounds for the <link linkend="GtkScale"><type>GtkScale</type></link> (through
the <link linkend="GtkRange"><type>GtkRange</type></link> 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).</para>
<refsect2><title>GtkScale as GtkBuildable</title><para>GtkScale supports a custom &lt;marks> element, which can contain multiple
&lt;mark> elements. The “value” and “position” attributes have the same
meaning as <link linkend="gtk-scale-add-mark"><function>gtk_scale_add_mark()</function></link> 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.</para>
</refsect2>
<refsect2><title>CSS nodes</title><informalexample><programlisting role="example"><![CDATA[
scale[.fine-tune][.marks-before][.marks-after]
├── marks.top
│   ├── mark
│   ┊    ├── [label]
│   ┊    ╰── indicator
┊   ┊
│   ╰── mark
├── [value][.top][.right][.bottom][.left]
├── trough
│   ├── [fill]
│   ├── [highlight]
│   ╰── slider
╰── marks.bottom
    ├── mark
    ┊    ├── indicator
    ┊    ╰── [label]
    ╰── mark
]]></programlisting></informalexample>
<para></para>
<para>GtkScale has a main CSS node with name scale and a subnode for its contents,
with subnodes named trough and slider.</para>
<para>The main node gets the style class .fine-tune added when the scale is in
'fine-tuning' mode.</para>
<para>If the scale has an origin (see <link linkend="gtk-scale-set-has-origin"><function>gtk_scale_set_has_origin()</function></link>), there is a
subnode with name highlight below the trough node that is used for rendering
the highlighted part of the trough.</para>
<para>If the scale is showing a fill level (see <link linkend="gtk-range-set-show-fill-level"><function>gtk_range_set_show_fill_level()</function></link>),
there is a subnode with name fill below the trough node that is used for
rendering the filled in part of the trough.</para>
<para>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.</para>
<para>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.</para>
<para>The main CSS node gets the 'marks-before' and/or 'marks-after' style classes
added depending on what marks are present.</para>
<para>If the scale is displaying the value (see <link linkend="GtkScale--draw-value"><type>“draw-value”</type></link>), there is
subnode with name value. This node will get the .top or .bottom style classes
similar to the marks node.</para>
</refsect2>

</refsect1>
<refsect1 id="GtkScale.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="GtkScaleFormatValueFunc" role="function">
<title>GtkScaleFormatValueFunc&#160;()</title>
<indexterm zone="GtkScaleFormatValueFunc"><primary>GtkScaleFormatValueFunc</primary></indexterm>
<programlisting language="C"><link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
<phrase role="c_punctuation">(</phrase>*GtkScaleFormatValueFunc<phrase role="c_punctuation">)</phrase> (<parameter><link linkend="GtkScale"><type>GtkScale</type></link> *scale</parameter>,
                            <parameter><link linkend="double"><type>double</type></link> value</parameter>,
                            <parameter><link linkend="gpointer"><type>gpointer</type></link> user_data</parameter>);</programlisting>
<refsect3 id="GtkScaleFormatValueFunc.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scale</para></entry>
<entry role="parameter_description"><para>The <link linkend="GtkScale"><type>GtkScale</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>The numeric value to format</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>user_data</para></entry>
<entry role="parameter_description"><para>user data. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>closure</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GtkScaleFormatValueFunc.returns" role="returns">
<title>Returns</title>
<para>A newly allocated string describing a textual representation
of the given numerical value. </para>
<para><emphasis role="annotation">[<acronym>not nullable</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-scale-new" role="function">
<title>gtk_scale_new&#160;()</title>
<indexterm zone="gtk-scale-new"><primary>gtk_scale_new</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_scale_new (<parameter><link linkend="GtkOrientation"><type>GtkOrientation</type></link> orientation</parameter>,
               <parameter><link linkend="GtkAdjustment"><type>GtkAdjustment</type></link> *adjustment</parameter>);</programlisting>
<para>Creates a new <link linkend="GtkScale"><type>GtkScale</type></link>.</para>
<refsect3 id="gtk-scale-new.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>orientation</para></entry>
<entry role="parameter_description"><para>the scale’s orientation.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>adjustment</para></entry>
<entry role="parameter_description"><para>the <link linkend="GtkAdjustment"><type>GtkAdjustment</type></link> which sets the range
of the scale, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to create a new adjustment. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-scale-new.returns" role="returns">
<title>Returns</title>
<para> a new <link linkend="GtkScale"><type>GtkScale</type></link></para>
</refsect3></refsect2>
<refsect2 id="gtk-scale-new-with-range" role="function">
<title>gtk_scale_new_with_range&#160;()</title>
<indexterm zone="gtk-scale-new-with-range"><primary>gtk_scale_new_with_range</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_scale_new_with_range (<parameter><link linkend="GtkOrientation"><type>GtkOrientation</type></link> orientation</parameter>,
                          <parameter><link linkend="gdouble"><type>gdouble</type></link> min</parameter>,
                          <parameter><link linkend="gdouble"><type>gdouble</type></link> max</parameter>,
                          <parameter><link linkend="gdouble"><type>gdouble</type></link> step</parameter>);</programlisting>
<para>Creates a new scale widget with the given orientation that lets the
user input a number between <parameter>min</parameter>
 and <parameter>max</parameter>
 (including <parameter>min</parameter>
 and <parameter>max</parameter>
)
with the increment <parameter>step</parameter>
.  <parameter>step</parameter>
 must be nonzero; it’s the distance
the slider moves when using the arrow keys to adjust the scale
value.</para>
<para>Note that the way in which the precision is derived works best if <parameter>step</parameter>

is a power of ten. If the resulting precision is not suitable for your
needs, use <link linkend="gtk-scale-set-digits"><function>gtk_scale_set_digits()</function></link> to correct it.</para>
<refsect3 id="gtk-scale-new-with-range.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>orientation</para></entry>
<entry role="parameter_description"><para>the scale’s orientation.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>min</para></entry>
<entry role="parameter_description"><para>minimum value</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>max</para></entry>
<entry role="parameter_description"><para>maximum value</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>step</para></entry>
<entry role="parameter_description"><para>step increment (tick size) used with keyboard shortcuts</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-scale-new-with-range.returns" role="returns">
<title>Returns</title>
<para> a new <link linkend="GtkScale"><type>GtkScale</type></link></para>
</refsect3></refsect2>
<refsect2 id="gtk-scale-set-format-value-func" role="function">
<title>gtk_scale_set_format_value_func&#160;()</title>
<indexterm zone="gtk-scale-set-format-value-func"><primary>gtk_scale_set_format_value_func</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_scale_set_format_value_func (<parameter><link linkend="GtkScale"><type>GtkScale</type></link> *scale</parameter>,
                                 <parameter><link linkend="GtkScaleFormatValueFunc"><type>GtkScaleFormatValueFunc</type></link> func</parameter>,
                                 <parameter><link linkend="gpointer"><type>gpointer</type></link> user_data</parameter>,
                                 <parameter><link linkend="GDestroyNotify"><type>GDestroyNotify</type></link> destroy_notify</parameter>);</programlisting>
<para><parameter>func</parameter>
 allows you to change how the scale value is displayed. The given
function will return an allocated string representing <parameter>value</parameter>
.
That string will then be used to display the scale's value.</para>
<para>If <link linkend="NULL:CAPS"><type>NULL</type></link> is passed as <parameter>func</parameter>
, the value will be displayed on
its own, rounded according to the value of the <link linkend="GtkScale--digits"><type>“digits”</type></link> property.</para>
<refsect3 id="gtk-scale-set-format-value-func.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scale</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkScale"><type>GtkScale</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>func</para></entry>
<entry role="parameter_description"><para>function that formats the value. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>user_data</para></entry>
<entry role="parameter_description"><para>user data to pass to <parameter>func</parameter>
. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>closure</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>destroy_notify</para></entry>
<entry role="parameter_description"><para>destroy function for <parameter>user_data</parameter>
. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-scale-set-digits" role="function">
<title>gtk_scale_set_digits&#160;()</title>
<indexterm zone="gtk-scale-set-digits"><primary>gtk_scale_set_digits</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_scale_set_digits (<parameter><link linkend="GtkScale"><type>GtkScale</type></link> *scale</parameter>,
                      <parameter><link linkend="gint"><type>gint</type></link> digits</parameter>);</programlisting>
<para>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 <link linkend="GtkScale--draw-value"><type>“draw-value”</type></link> is
<link linkend="TRUE:CAPS"><literal>TRUE</literal></link> when the value changes. If you want to enforce rounding the value when
<link linkend="GtkScale--draw-value"><type>“draw-value”</type></link> is <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>, you can set <link linkend="GtkRange--round-digits"><type>“round-digits”</type></link> instead.</para>
<para>Note that rounding to a small number of digits can interfere with
the smooth autoscrolling that is built into <link linkend="GtkScale"><type>GtkScale</type></link>. As an alternative,
you can use <link linkend="gtk-scale-set-format-value-func"><function>gtk_scale_set_format_value_func()</function></link> to format the displayed
value yourself.</para>
<refsect3 id="gtk-scale-set-digits.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scale</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkScale"><type>GtkScale</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>digits</para></entry>
<entry role="parameter_description"><para>the number of decimal places to display,
e.g. use 1 to display 1.0, 2 to display 1.00, etc</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-scale-set-draw-value" role="function">
<title>gtk_scale_set_draw_value&#160;()</title>
<indexterm zone="gtk-scale-set-draw-value"><primary>gtk_scale_set_draw_value</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_scale_set_draw_value (<parameter><link linkend="GtkScale"><type>GtkScale</type></link> *scale</parameter>,
                          <parameter><link linkend="gboolean"><type>gboolean</type></link> draw_value</parameter>);</programlisting>
<para>Specifies whether the current value is displayed as a string next 
to the slider.</para>
<refsect3 id="gtk-scale-set-draw-value.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scale</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkScale"><type>GtkScale</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>draw_value</para></entry>
<entry role="parameter_description"><para><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> to draw the value</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-scale-set-has-origin" role="function">
<title>gtk_scale_set_has_origin&#160;()</title>
<indexterm zone="gtk-scale-set-has-origin"><primary>gtk_scale_set_has_origin</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_scale_set_has_origin (<parameter><link linkend="GtkScale"><type>GtkScale</type></link> *scale</parameter>,
                          <parameter><link linkend="gboolean"><type>gboolean</type></link> has_origin</parameter>);</programlisting>
<para>If <link linkend="GtkScale--has-origin"><type>“has-origin”</type></link> is set to <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> (the default), the scale will
highlight the part of the trough between the origin (bottom or left side)
and the current value.</para>
<refsect3 id="gtk-scale-set-has-origin.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scale</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkScale"><type>GtkScale</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>has_origin</para></entry>
<entry role="parameter_description"><para><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the scale has an origin</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-scale-set-value-pos" role="function">
<title>gtk_scale_set_value_pos&#160;()</title>
<indexterm zone="gtk-scale-set-value-pos"><primary>gtk_scale_set_value_pos</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_scale_set_value_pos (<parameter><link linkend="GtkScale"><type>GtkScale</type></link> *scale</parameter>,
                         <parameter><link linkend="GtkPositionType"><type>GtkPositionType</type></link> pos</parameter>);</programlisting>
<para>Sets the position in which the current value is displayed.</para>
<refsect3 id="gtk-scale-set-value-pos.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scale</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkScale"><type>GtkScale</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>pos</para></entry>
<entry role="parameter_description"><para>the position in which the current value is displayed</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-scale-get-digits" role="function">
<title>gtk_scale_get_digits&#160;()</title>
<indexterm zone="gtk-scale-get-digits"><primary>gtk_scale_get_digits</primary></indexterm>
<programlisting language="C"><link linkend="gint"><returnvalue>gint</returnvalue></link>
gtk_scale_get_digits (<parameter><link linkend="GtkScale"><type>GtkScale</type></link> *scale</parameter>);</programlisting>
<para>Gets the number of decimal places that are displayed in the value.</para>
<refsect3 id="gtk-scale-get-digits.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scale</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkScale"><type>GtkScale</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-scale-get-digits.returns" role="returns">
<title>Returns</title>
<para> the number of decimal places that are displayed</para>
</refsect3></refsect2>
<refsect2 id="gtk-scale-get-draw-value" role="function">
<title>gtk_scale_get_draw_value&#160;()</title>
<indexterm zone="gtk-scale-get-draw-value"><primary>gtk_scale_get_draw_value</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_scale_get_draw_value (<parameter><link linkend="GtkScale"><type>GtkScale</type></link> *scale</parameter>);</programlisting>
<para>Returns whether the current value is displayed as a string 
next to the slider.</para>
<refsect3 id="gtk-scale-get-draw-value.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scale</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkScale"><type>GtkScale</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-scale-get-draw-value.returns" role="returns">
<title>Returns</title>
<para> whether the current value is displayed as a string</para>
</refsect3></refsect2>
<refsect2 id="gtk-scale-get-has-origin" role="function">
<title>gtk_scale_get_has_origin&#160;()</title>
<indexterm zone="gtk-scale-get-has-origin"><primary>gtk_scale_get_has_origin</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_scale_get_has_origin (<parameter><link linkend="GtkScale"><type>GtkScale</type></link> *scale</parameter>);</programlisting>
<para>Returns whether the scale has an origin.</para>
<refsect3 id="gtk-scale-get-has-origin.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scale</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkScale"><type>GtkScale</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-scale-get-has-origin.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the scale has an origin.</para>
</refsect3></refsect2>
<refsect2 id="gtk-scale-get-value-pos" role="function">
<title>gtk_scale_get_value_pos&#160;()</title>
<indexterm zone="gtk-scale-get-value-pos"><primary>gtk_scale_get_value_pos</primary></indexterm>
<programlisting language="C"><link linkend="GtkPositionType"><returnvalue>GtkPositionType</returnvalue></link>
gtk_scale_get_value_pos (<parameter><link linkend="GtkScale"><type>GtkScale</type></link> *scale</parameter>);</programlisting>
<para>Gets the position in which the current value is displayed.</para>
<refsect3 id="gtk-scale-get-value-pos.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scale</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkScale"><type>GtkScale</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-scale-get-value-pos.returns" role="returns">
<title>Returns</title>
<para> the position in which the current value is displayed</para>
</refsect3></refsect2>
<refsect2 id="gtk-scale-get-layout" role="function">
<title>gtk_scale_get_layout&#160;()</title>
<indexterm zone="gtk-scale-get-layout"><primary>gtk_scale_get_layout</primary></indexterm>
<programlisting language="C"><link linkend="PangoLayout"><returnvalue>PangoLayout</returnvalue></link>&#160;*
gtk_scale_get_layout (<parameter><link linkend="GtkScale"><type>GtkScale</type></link> *scale</parameter>);</programlisting>
<para>Gets the <link linkend="PangoLayout"><type>PangoLayout</type></link> used to display the scale. The returned
object is owned by the scale so does not need to be freed by
the caller.</para>
<refsect3 id="gtk-scale-get-layout.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scale</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkScale"><type>GtkScale</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-scale-get-layout.returns" role="returns">
<title>Returns</title>
<para>the <link linkend="PangoLayout"><type>PangoLayout</type></link> for this scale,
or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the <link linkend="GtkScale--draw-value"><type>“draw-value”</type></link> property is <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>][<acronym>nullable</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-scale-get-layout-offsets" role="function">
<title>gtk_scale_get_layout_offsets&#160;()</title>
<indexterm zone="gtk-scale-get-layout-offsets"><primary>gtk_scale_get_layout_offsets</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_scale_get_layout_offsets (<parameter><link linkend="GtkScale"><type>GtkScale</type></link> *scale</parameter>,
                              <parameter><link linkend="gint"><type>gint</type></link> *x</parameter>,
                              <parameter><link linkend="gint"><type>gint</type></link> *y</parameter>);</programlisting>
<para>Obtains the coordinates where the scale will draw the 
<link linkend="PangoLayout"><type>PangoLayout</type></link> representing the text in the scale. Remember
when using the <link linkend="PangoLayout"><type>PangoLayout</type></link> function you need to convert to
and from pixels using <link linkend="PANGO-PIXELS:CAPS"><function>PANGO_PIXELS()</function></link> or <link linkend="PANGO-SCALE:CAPS"><type>PANGO_SCALE</type></link>. </para>
<para>If the <link linkend="GtkScale--draw-value"><type>“draw-value”</type></link> property is <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>, the return 
values are undefined.</para>
<refsect3 id="gtk-scale-get-layout-offsets.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scale</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkScale"><type>GtkScale</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>x</para></entry>
<entry role="parameter_description"><para>location to store X offset of layout, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>allow-none</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>y</para></entry>
<entry role="parameter_description"><para>location to store Y offset of layout, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>allow-none</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-scale-add-mark" role="function">
<title>gtk_scale_add_mark&#160;()</title>
<indexterm zone="gtk-scale-add-mark"><primary>gtk_scale_add_mark</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_scale_add_mark (<parameter><link linkend="GtkScale"><type>GtkScale</type></link> *scale</parameter>,
                    <parameter><link linkend="gdouble"><type>gdouble</type></link> value</parameter>,
                    <parameter><link linkend="GtkPositionType"><type>GtkPositionType</type></link> position</parameter>,
                    <parameter>const <link linkend="gchar"><type>gchar</type></link> *markup</parameter>);</programlisting>
<para>Adds a mark at <parameter>value</parameter>
.</para>
<para>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.</para>
<para>If <parameter>markup</parameter>
 is not <link linkend="NULL:CAPS"><literal>NULL</literal></link>, text is shown next to the tick mark.</para>
<para>To remove marks from a scale, use <link linkend="gtk-scale-clear-marks"><function>gtk_scale_clear_marks()</function></link>.</para>
<refsect3 id="gtk-scale-add-mark.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scale</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkScale"><type>GtkScale</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>the value at which the mark is placed, must be between
the lower and upper limits of the scales’ adjustment</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>position</para></entry>
<entry role="parameter_description"><para>where to draw the mark. For a horizontal scale, <link linkend="GTK-POS-TOP:CAPS"><type>GTK_POS_TOP</type></link>
and <link linkend="GTK-POS-LEFT:CAPS"><literal>GTK_POS_LEFT</literal></link> are drawn above the scale, anything else below.
For a vertical scale, <link linkend="GTK-POS-LEFT:CAPS"><type>GTK_POS_LEFT</type></link> and <link linkend="GTK-POS-TOP:CAPS"><literal>GTK_POS_TOP</literal></link> are drawn to
the left of the scale, anything else to the right.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>markup</para></entry>
<entry role="parameter_description"><para>Text to be shown at the mark, using <link linkend="PangoMarkupFormat">Pango markup</link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>allow-none</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-scale-clear-marks" role="function">
<title>gtk_scale_clear_marks&#160;()</title>
<indexterm zone="gtk-scale-clear-marks"><primary>gtk_scale_clear_marks</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_scale_clear_marks (<parameter><link linkend="GtkScale"><type>GtkScale</type></link> *scale</parameter>);</programlisting>
<para>Removes any marks that have been added with <link linkend="gtk-scale-add-mark"><function>gtk_scale_add_mark()</function></link>.</para>
<refsect3 id="gtk-scale-clear-marks.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scale</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkScale"><type>GtkScale</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

</refsect1>
<refsect1 id="GtkScale.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GtkScale-struct" role="struct">
<title>struct GtkScale</title>
<indexterm zone="GtkScale-struct"><primary>GtkScale</primary></indexterm>
<programlisting language="C">struct GtkScale;</programlisting>
</refsect2>

</refsect1>
<refsect1 id="GtkScale.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkScale--digits" role="property"><title>The <literal>“digits”</literal> property</title>
<indexterm zone="GtkScale--digits"><primary>GtkScale:digits</primary></indexterm>
<programlisting>  “digits”                   <link linkend="gint"><type>gint</type></link></programlisting>
<para>The number of decimal places that are displayed in the value.</para><para>Owner: GtkScale</para>
<para>Flags: Read / Write</para>
<para>Allowed values: [-1,64]</para>
<para>Default value: 1</para>
</refsect2>
<refsect2 id="GtkScale--draw-value" role="property"><title>The <literal>“draw-value”</literal> property</title>
<indexterm zone="GtkScale--draw-value"><primary>GtkScale:draw-value</primary></indexterm>
<programlisting>  “draw-value”               <link linkend="gboolean"><type>gboolean</type></link></programlisting>
<para>Whether the current value is displayed as a string next to the slider.</para><para>Owner: GtkScale</para>
<para>Flags: Read / Write</para>
<para>Default value: TRUE</para>
</refsect2>
<refsect2 id="GtkScale--has-origin" role="property"><title>The <literal>“has-origin”</literal> property</title>
<indexterm zone="GtkScale--has-origin"><primary>GtkScale:has-origin</primary></indexterm>
<programlisting>  “has-origin”               <link linkend="gboolean"><type>gboolean</type></link></programlisting>
<para>Whether the scale has an origin.</para><para>Owner: GtkScale</para>
<para>Flags: Read / Write</para>
<para>Default value: TRUE</para>
</refsect2>
<refsect2 id="GtkScale--value-pos" role="property"><title>The <literal>“value-pos”</literal> property</title>
<indexterm zone="GtkScale--value-pos"><primary>GtkScale:value-pos</primary></indexterm>
<programlisting>  “value-pos”                <link linkend="GtkPositionType"><type>GtkPositionType</type></link></programlisting>
<para>The position in which the current value is displayed.</para><para>Owner: GtkScale</para>
<para>Flags: Read / Write</para>
<para>Default value: GTK_POS_TOP</para>
</refsect2>

</refsect1>

</refentry>
