1
<refentry id="GtkScaleButton">
3
<refentrytitle role="top_of_page">GtkScaleButton</refentrytitle>
4
<manvolnum>3</manvolnum>
5
<refmiscinfo>GTK Library</refmiscinfo>
9
<refname>GtkScaleButton</refname>
10
<refpurpose></refpurpose>
11
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
14
<refsynopsisdiv role="synopsis">
15
<title role="synopsis.title">Synopsis</title>
19
#include <gtk/gtk.h>
22
<link linkend="GtkScaleButton-struct">GtkScaleButton</link>;
23
<link linkend="GtkWidget">GtkWidget</link>* <link linkend="gtk-scale-button-new">gtk_scale_button_new</link> (<link linkend="GtkIconSize">GtkIconSize</link> size,
24
<link linkend="gdouble">gdouble</link> min,
25
<link linkend="gdouble">gdouble</link> max,
26
<link linkend="gdouble">gdouble</link> step,
27
const <link linkend="gchar">gchar</link> **icons);
28
<link linkend="void">void</link> <link linkend="gtk-scale-button-set-adjustment">gtk_scale_button_set_adjustment</link> (<link linkend="GtkScaleButton">GtkScaleButton</link> *button,
29
<link linkend="GtkAdjustment">GtkAdjustment</link> *adjustment);
30
<link linkend="void">void</link> <link linkend="gtk-scale-button-set-icons">gtk_scale_button_set_icons</link> (<link linkend="GtkScaleButton">GtkScaleButton</link> *button,
31
const <link linkend="gchar">gchar</link> **icons);
32
<link linkend="void">void</link> <link linkend="gtk-scale-button-set-value">gtk_scale_button_set_value</link> (<link linkend="GtkScaleButton">GtkScaleButton</link> *button,
33
<link linkend="gdouble">gdouble</link> value);
34
<link linkend="GtkAdjustment">GtkAdjustment</link>* <link linkend="gtk-scale-button-get-adjustment">gtk_scale_button_get_adjustment</link> (<link linkend="GtkScaleButton">GtkScaleButton</link> *button);
35
<link linkend="gdouble">gdouble</link> <link linkend="gtk-scale-button-get-value">gtk_scale_button_get_value</link> (<link linkend="GtkScaleButton">GtkScaleButton</link> *button);
41
<refsect1 role="object_hierarchy">
42
<title role="object_hierarchy.title">Object Hierarchy</title>
45
<link linkend="GObject">GObject</link>
46
+----<link linkend="GInitiallyUnowned">GInitiallyUnowned</link>
47
+----<link linkend="GtkObject">GtkObject</link>
48
+----<link linkend="GtkWidget">GtkWidget</link>
49
+----<link linkend="GtkContainer">GtkContainer</link>
50
+----<link linkend="GtkBin">GtkBin</link>
51
+----<link linkend="GtkButton">GtkButton</link>
53
+----<link linkend="GtkVolumeButton">GtkVolumeButton</link>
60
<refsect1 role="impl_interfaces">
61
<title role="impl_interfaces.title">Implemented Interfaces</title>
63
GtkScaleButton implements
64
<link linkend="AtkImplementorIface">AtkImplementorIface</link>.</para>
69
<refsect1 role="properties">
70
<title role="properties.title">Properties</title>
73
<link linkend="GtkScaleButton--adjustment">adjustment</link> <link linkend="GtkAdjustment">GtkAdjustment</link> : Read / Write
74
<link linkend="GtkScaleButton--size">size</link> <link linkend="GtkIconSize">GtkIconSize</link> : Read / Write
75
<link linkend="GtkScaleButton--value">value</link> <link linkend="gdouble">gdouble</link> : Read / Write
79
<refsect1 role="signal_proto">
80
<title role="signal_proto.title">Signals</title>
83
<link linkend="GtkScaleButton-popdown">popdown</link> : Run Last / Action
84
<link linkend="GtkScaleButton-popup">popup</link> : Run Last / Action
85
<link linkend="GtkScaleButton-value-changed">value-changed</link> : Run Last
90
<refsect1 role="desc">
91
<title role="desc.title">Description</title>
97
<refsect1 role="details">
98
<title role="details.title">Details</title>
100
<title><anchor id="GtkScaleButton-struct" role="struct"/>GtkScaleButton</title>
101
<indexterm><primary>GtkScaleButton</primary></indexterm><programlisting>typedef struct _GtkScaleButton GtkScaleButton;</programlisting>
106
<title><anchor id="gtk-scale-button-new" role="function" condition="since:2.12"/>gtk_scale_button_new ()</title>
107
<indexterm role="2.12"><primary>gtk_scale_button_new</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link>* gtk_scale_button_new (<link linkend="GtkIconSize">GtkIconSize</link> size,
108
<link linkend="gdouble">gdouble</link> min,
109
<link linkend="gdouble">gdouble</link> max,
110
<link linkend="gdouble">gdouble</link> step,
111
const <link linkend="gchar">gchar</link> **icons);</programlisting>
113
Creates a <link linkend="GtkScaleButton"><type>GtkScaleButton</type></link>, with a range between <parameter>min</parameter> and <parameter>max</parameter>, with
114
a stepping of <parameter>step</parameter>.</para>
117
</para><variablelist role="params">
118
<varlistentry><term><parameter>size</parameter> :</term>
119
<listitem><simpara> a stock icon size
120
</simpara></listitem></varlistentry>
121
<varlistentry><term><parameter>min</parameter> :</term>
122
<listitem><simpara> the minimum value of the scale (usually 0)
123
</simpara></listitem></varlistentry>
124
<varlistentry><term><parameter>max</parameter> :</term>
125
<listitem><simpara> the maximum value of the scale (usually 100)
126
</simpara></listitem></varlistentry>
127
<varlistentry><term><parameter>step</parameter> :</term>
128
<listitem><simpara> the stepping of value when a scroll-wheel event,
129
or up/down arrow event occurs (usually 2)
130
</simpara></listitem></varlistentry>
131
<varlistentry><term><parameter>icons</parameter> :</term>
132
<listitem><simpara> a <link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminated array of icon names, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if
133
you want to set the list later with <link linkend="gtk-scale-button-set-icons"><function>gtk_scale_button_set_icons()</function></link>
134
</simpara></listitem></varlistentry>
135
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a new <link linkend="GtkScaleButton"><type>GtkScaleButton</type></link>
137
</simpara></listitem></varlistentry>
138
</variablelist><para role="since">Since 2.12
141
<title><anchor id="gtk-scale-button-set-adjustment" role="function" condition="since:2.12"/>gtk_scale_button_set_adjustment ()</title>
142
<indexterm role="2.12"><primary>gtk_scale_button_set_adjustment</primary></indexterm><programlisting><link linkend="void">void</link> gtk_scale_button_set_adjustment (<link linkend="GtkScaleButton">GtkScaleButton</link> *button,
143
<link linkend="GtkAdjustment">GtkAdjustment</link> *adjustment);</programlisting>
145
Sets the <link linkend="GtkAdjustment"><type>GtkAdjustment</type></link> to be used as a model for the <link linkend="GtkScaleButton"><type>GtkScaleButton</type></link>'s scale.
146
See <link linkend="gtk-range-set-adjustment"><function>gtk_range_set_adjustment()</function></link> for details.</para>
149
</para><variablelist role="params">
150
<varlistentry><term><parameter>button</parameter> :</term>
151
<listitem><simpara> a <link linkend="GtkScaleButton"><type>GtkScaleButton</type></link>
152
</simpara></listitem></varlistentry>
153
<varlistentry><term><parameter>adjustment</parameter> :</term>
154
<listitem><simpara> a <link linkend="GtkAdjustment"><type>GtkAdjustment</type></link>
155
</simpara></listitem></varlistentry>
156
</variablelist><para role="since">Since 2.12
159
<title><anchor id="gtk-scale-button-set-icons" role="function"/>gtk_scale_button_set_icons ()</title>
160
<indexterm><primary>gtk_scale_button_set_icons</primary></indexterm><programlisting><link linkend="void">void</link> gtk_scale_button_set_icons (<link linkend="GtkScaleButton">GtkScaleButton</link> *button,
161
const <link linkend="gchar">gchar</link> **icons);</programlisting>
163
Sets the icons to be used by the scale button. The first item in the array
164
will be used in the button when the current value is the lowest value, the
165
second item for the highest value. All the subsequent icons will be used for
166
all the other values, spread evenly over the range of values.
169
If there's only one icon in the <parameter>icons</parameter> array, it will be used for all the
170
values. If only two icons are in the <parameter>icons</parameter> array, the first one will be
171
used for the bottom 50% of the scale, and the second one for the top 50%.
172
So it is recommended to use at least 3 icons so that the <link linkend="GtkScaleButton"><type>GtkScaleButton</type></link>
173
reflects the current value of the scale better for the users.
179
</para><variablelist role="params">
180
<varlistentry><term><parameter>button</parameter> :</term>
181
<listitem><simpara> a <link linkend="GtkScaleButton"><type>GtkScaleButton</type></link>
182
</simpara></listitem></varlistentry>
183
<varlistentry><term><parameter>icons</parameter> :</term>
184
<listitem><simpara> a <link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminated array of icon names
185
</simpara></listitem></varlistentry>
186
</variablelist></refsect2>
188
<title><anchor id="gtk-scale-button-set-value" role="function" condition="since:2.12"/>gtk_scale_button_set_value ()</title>
189
<indexterm role="2.12"><primary>gtk_scale_button_set_value</primary></indexterm><programlisting><link linkend="void">void</link> gtk_scale_button_set_value (<link linkend="GtkScaleButton">GtkScaleButton</link> *button,
190
<link linkend="gdouble">gdouble</link> value);</programlisting>
192
Sets the current value of the scale; if the value is outside the minimum or
193
maximum range values, it will be clamped to fit inside them. The scale button
194
emits the "value_changed" signal if the value changes.</para>
197
</para><variablelist role="params">
198
<varlistentry><term><parameter>button</parameter> :</term>
199
<listitem><simpara> a <link linkend="GtkScaleButton"><type>GtkScaleButton</type></link>
200
</simpara></listitem></varlistentry>
201
<varlistentry><term><parameter>value</parameter> :</term>
202
<listitem><simpara> new value of the scale button
203
</simpara></listitem></varlistentry>
204
</variablelist><para role="since">Since 2.12
207
<title><anchor id="gtk-scale-button-get-adjustment" role="function" condition="since:2.12"/>gtk_scale_button_get_adjustment ()</title>
208
<indexterm role="2.12"><primary>gtk_scale_button_get_adjustment</primary></indexterm><programlisting><link linkend="GtkAdjustment">GtkAdjustment</link>* gtk_scale_button_get_adjustment (<link linkend="GtkScaleButton">GtkScaleButton</link> *button);</programlisting>
210
Gets the <link linkend="GtkAdjustment"><type>GtkAdjustment</type></link> associated with the <link linkend="GtkScaleButton"><type>GtkScaleButton</type></link>'s scale.
211
See <link linkend="gtk-range-get-adjustment"><function>gtk_range_get_adjustment()</function></link> for details.</para>
214
</para><variablelist role="params">
215
<varlistentry><term><parameter>button</parameter> :</term>
216
<listitem><simpara> a <link linkend="GtkScaleButton"><type>GtkScaleButton</type></link>
217
</simpara></listitem></varlistentry>
218
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the adjustment associated with the scale
220
</simpara></listitem></varlistentry>
221
</variablelist><para role="since">Since 2.12
224
<title><anchor id="gtk-scale-button-get-value" role="function" condition="since:2.12"/>gtk_scale_button_get_value ()</title>
225
<indexterm role="2.12"><primary>gtk_scale_button_get_value</primary></indexterm><programlisting><link linkend="gdouble">gdouble</link> gtk_scale_button_get_value (<link linkend="GtkScaleButton">GtkScaleButton</link> *button);</programlisting>
227
Gets the current value of the scale button.</para>
230
</para><variablelist role="params">
231
<varlistentry><term><parameter>button</parameter> :</term>
232
<listitem><simpara> a <link linkend="GtkScaleButton"><type>GtkScaleButton</type></link>
233
</simpara></listitem></varlistentry>
234
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> current value of the scale button
236
</simpara></listitem></varlistentry>
237
</variablelist><para role="since">Since 2.12
241
<refsect1 role="property_details">
242
<title role="property_details.title">Property Details</title>
243
<refsect2><title><anchor id="GtkScaleButton--adjustment"/>The :<literal>adjustment</literal> property</title>
244
<indexterm><primary>GtkScaleButton:adjustment</primary></indexterm><programlisting> adjustment <link linkend="GtkAdjustment">GtkAdjustment</link> : Read / Write</programlisting>
245
<para>The GtkAdjustment that contains the current value of this scale button object.</para></refsect2>
246
<refsect2><title><anchor id="GtkScaleButton--size"/>The :<literal>size</literal> property</title>
247
<indexterm><primary>GtkScaleButton:size</primary></indexterm><programlisting> size <link linkend="GtkIconSize">GtkIconSize</link> : Read / Write</programlisting>
248
<para>The icon size.</para><para>Default value: GTK_ICON_SIZE_SMALL_TOOLBAR</para>
250
<refsect2><title><anchor id="GtkScaleButton--value"/>The :<literal>value</literal> property</title>
251
<indexterm><primary>GtkScaleButton:value</primary></indexterm><programlisting> value <link linkend="gdouble">gdouble</link> : Read / Write</programlisting>
252
<para>The value of the scale.</para><para>Default value: 0</para>
257
<refsect1 role="signals">
258
<title role="signals.title">Signal Details</title>
259
<refsect2><title><anchor id="GtkScaleButton-popdown"/>The <literal>::popdown</literal> signal</title>
260
<indexterm><primary>GtkScaleButton::popdown</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="GtkScaleButton">GtkScaleButton</link> *scalebutton,
261
<link linkend="gpointer">gpointer</link> user_data) : Run Last / Action</programlisting>
264
</para><variablelist role="params">
265
<varlistentry><term><parameter>scalebutton</parameter> :</term>
266
<listitem><simpara>the object which received the signal.
268
</simpara></listitem></varlistentry>
269
<varlistentry><term><parameter>user_data</parameter> :</term>
270
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
271
</variablelist></refsect2><refsect2><title><anchor id="GtkScaleButton-popup"/>The <literal>::popup</literal> signal</title>
272
<indexterm><primary>GtkScaleButton::popup</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="GtkScaleButton">GtkScaleButton</link> *scalebutton,
273
<link linkend="gpointer">gpointer</link> user_data) : Run Last / Action</programlisting>
276
</para><variablelist role="params">
277
<varlistentry><term><parameter>scalebutton</parameter> :</term>
278
<listitem><simpara>the object which received the signal.
280
</simpara></listitem></varlistentry>
281
<varlistentry><term><parameter>user_data</parameter> :</term>
282
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
283
</variablelist></refsect2><refsect2><title><anchor id="GtkScaleButton-value-changed"/>The <literal>::value-changed</literal> signal</title>
284
<indexterm role="2.12"><primary>GtkScaleButton::value-changed</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="GtkScaleButton">GtkScaleButton</link> *button,
285
<link linkend="gdouble">gdouble</link> arg1,
286
<link linkend="gpointer">gpointer</link> user_data) : Run Last</programlisting>
288
Emitted when the value field has changed.</para>
291
</para><variablelist role="params">
292
<varlistentry><term><parameter>button</parameter> :</term>
293
<listitem><simpara> the object that received the signal
294
</simpara></listitem></varlistentry>
295
<varlistentry><term><parameter>user_data</parameter> :</term>
296
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
297
</variablelist><para>Since 2.12