~canonical-dx-team/ubuntu/maverick/gtk+2.0/menuproxy

« back to all changes in this revision

Viewing changes to docs/reference/gtk/xml/gtkscale.xml

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-05-04 12:24:25 UTC
  • mfrom: (1.1.21 upstream)
  • Revision ID: james.westby@ubuntu.com-20070504122425-0m8midgzrp40y8w2
Tags: 2.10.12-1ubuntu1
* Sync with Debian
* New upstream version:
  Fixed bugs:
  - 379414 file chooser warnings when changing path in the entry
  - 418585 GtkFileChooserDefault sizing code is not DPI independent
  - 419568 Crash in search if start with special letter
  - 435062 build dies with icon cache validation
  - 379399 Segfault to call gtk_print_operation_run twice.
  - 387889 cups backend has problems when there are too many printers
  - 418531 invalid read to gtkicontheme.c gtk_icon_theme_lookup_icon...
  - 423916 crash in color scheme code
  - 424042 Segmentation fault while quickly pressing Alt+arrows
  - 415260 Protect against negative indices when setting values in G...
  - 419171 XGetVisualInfo() may not set nxvisuals
  - 128852 Gdk cursors don't look good on win32
  - 344657 Ctrl-H doesn't toggle "Show Hidden Files" setting
  - 345345 PrintOperation::paginate is not emitted for class handler
  - 347567 GtkPrintOperation::end-print is not emitted if it's cance...
  - 369112 gtk_ui_manager_add_ui should accept unnamed separator
  - 392015 Selected menu item invisible on Windows Vista
  - 399253 MS-Windows Theme Bottom Tab placement rendering glitches
  - 399425 gtk_input_dialog_fill_axes() adds child to gtkscrolledwin...
  - 403251 [patch] little memory leak in GtkPrintJob
  - 403267 [patch] memory leak in GtkPageSetupUnixDialog
  - 403470 MS-Windows Theme tab placement other than on top leaks a ...
  - 404506 Windows system fonts that have multi-byte font names cann...
  - 405089 Incorrect window placement for GtkEventBox private window
  - 405515 Minor leak in gtkfilesystemmodel.c
  - 405539 gdk_pixbuf_save() for PNG saver can return FALSE without ...
  - 415681 gdk_window_clear_area includes an extra line and column o...
  - 418219 GtkRecentChooser should apply filter before sorting and c...
  - 418403 Scroll to printer after selecting it from settings
  - 421985 _gtk_print_operation_platform_backend_launch_preview
  - 421990 gtk_print_job_get_surface
  - 421993 gtk_print_operation_init
  - 423064 Conditional jump or move depends on uninitialised value(s...
  - 423722 Fix printing header in gtk-demo
  - 424168 gtk_print_operation_run on async preview
  - 425655 Don't install gtk+-unix-print-2.0.pc on non-UNIX platforms
  - 425786 GDK segfaults if XineramaQueryScreens fails
  - 428665 Lpr Backend gets stuck in infinite loop during gtk_enumer...
  - 429902 GtkPrintOperation leaks cairo contextes
  - 431997 First delay of GdkPixbufAnimationIter is wrong
  - 433242 Inconsistent scroll arrow position calculations
  - 433972 Placing gtk.Expander inside a gtk.TextView() changes gtk....
  - 434261 _gtk_toolbar_elide_underscores incorrectly handles some s...
  - 383354 ctrl-L should make 'Location' entry disappear
  - 418673 gtk_recent_manager_add_item
  - 429732 gtk_accel_group_finalize accesses invalid memory
  - 435028 WM_CLIENT_LEADER is wrong on the leader_window
  - 431067 Background of the header window is not updated
  - 338843 add recent files support inside the ui manager
  - 148535 add drop shadow to menus, tooltips, etc. under Windows XP
* debian/control.in:
  - Conflicts on ubuntulooks (<= 0.9.11-1)
* debian/patches/15_default-fallback-icon-theme.patch:
  - patch from Debian, fallback on gnome icon theme

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<refentry id="GtkScale">
 
2
<refmeta>
 
3
<refentrytitle role="top_of_page">GtkScale</refentrytitle>
 
4
<manvolnum>3</manvolnum>
 
5
<refmiscinfo>GTK Library</refmiscinfo>
 
6
</refmeta>
 
7
 
 
8
<refnamediv>
 
9
<refname>GtkScale</refname>
 
10
<refpurpose>Base class for GtkHScale and GtkVScale</refpurpose>
 
11
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
 
12
</refnamediv>
 
13
 
 
14
<refsynopsisdiv role="synopsis">
 
15
<title role="synopsis.title">Synopsis</title>
 
16
 
 
17
<synopsis>
 
18
 
 
19
#include &lt;gtk/gtk.h&gt;
 
20
 
 
21
 
 
22
                    <link linkend="GtkScale-struct">GtkScale</link>;
 
23
<link linkend="void">void</link>                <link linkend="gtk-scale-set-digits">gtk_scale_set_digits</link>                (<link linkend="GtkScale">GtkScale</link> *scale,
 
24
                                                         <link linkend="gint">gint</link> digits);
 
25
<link linkend="void">void</link>                <link linkend="gtk-scale-set-draw-value">gtk_scale_set_draw_value</link>            (<link linkend="GtkScale">GtkScale</link> *scale,
 
26
                                                         <link linkend="gboolean">gboolean</link> draw_value);
 
27
<link linkend="void">void</link>                <link linkend="gtk-scale-set-value-pos">gtk_scale_set_value_pos</link>             (<link linkend="GtkScale">GtkScale</link> *scale,
 
28
                                                         <link linkend="GtkPositionType">GtkPositionType</link> pos);
 
29
<link linkend="gint">gint</link>                <link linkend="gtk-scale-get-digits">gtk_scale_get_digits</link>                (<link linkend="GtkScale">GtkScale</link> *scale);
 
30
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-scale-get-draw-value">gtk_scale_get_draw_value</link>            (<link linkend="GtkScale">GtkScale</link> *scale);
 
31
<link linkend="GtkPositionType">GtkPositionType</link>     <link linkend="gtk-scale-get-value-pos">gtk_scale_get_value_pos</link>             (<link linkend="GtkScale">GtkScale</link> *scale);
 
32
<link linkend="PangoLayout">PangoLayout</link>*        <link linkend="gtk-scale-get-layout">gtk_scale_get_layout</link>                (<link linkend="GtkScale">GtkScale</link> *scale);
 
33
<link linkend="void">void</link>                <link linkend="gtk-scale-get-layout-offsets">gtk_scale_get_layout_offsets</link>        (<link linkend="GtkScale">GtkScale</link> *scale,
 
34
                                                         <link linkend="gint">gint</link> *x,
 
35
                                                         <link linkend="gint">gint</link> *y);
 
36
 
 
37
 
 
38
</synopsis>
 
39
</refsynopsisdiv>
 
40
 
 
41
<refsect1 role="object_hierarchy">
 
42
<title role="object_hierarchy.title">Object Hierarchy</title>
 
43
<synopsis>
 
44
 
 
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="GtkRange">GtkRange</link>
 
50
                           +----GtkScale
 
51
                                 +----<link linkend="GtkHScale">GtkHScale</link>
 
52
                                 +----<link linkend="GtkVScale">GtkVScale</link>
 
53
</synopsis>
 
54
 
 
55
</refsect1>
 
56
 
 
57
 
 
58
 
 
59
<refsect1 role="impl_interfaces">
 
60
<title role="impl_interfaces.title">Implemented Interfaces</title>
 
61
<para>
 
62
GtkScale implements
 
63
 <link linkend="AtkImplementorIface">AtkImplementorIface</link>.</para>
 
64
 
 
65
</refsect1>
 
66
 
 
67
 
 
68
<refsect1 role="properties">
 
69
<title role="properties.title">Properties</title>
 
70
<synopsis>
 
71
 
 
72
  &quot;<link linkend="GtkScale--digits">digits</link>&quot;                   <link linkend="gint">gint</link>                  : Read / Write
 
73
  &quot;<link linkend="GtkScale--draw-value">draw-value</link>&quot;               <link linkend="gboolean">gboolean</link>              : Read / Write
 
74
  &quot;<link linkend="GtkScale--value-pos">value-pos</link>&quot;                <link linkend="GtkPositionType">GtkPositionType</link>       : Read / Write
 
75
</synopsis>
 
76
</refsect1>
 
77
<refsect1 role="style_properties">
 
78
<title role="style_properties.title">Style Properties</title>
 
79
<synopsis>
 
80
 
 
81
  &quot;<link linkend="GtkScale--slider-length">slider-length</link>&quot;            <link linkend="gint">gint</link>                  : Read
 
82
  &quot;<link linkend="GtkScale--value-spacing">value-spacing</link>&quot;            <link linkend="gint">gint</link>                  : Read
 
83
</synopsis>
 
84
</refsect1>
 
85
 
 
86
<refsect1 role="signal_proto">
 
87
<title role="signal_proto.title">Signals</title>
 
88
<synopsis>
 
89
 
 
90
  &quot;<link linkend="GtkScale-format-value">format-value</link>&quot;                                   : Run Last
 
91
</synopsis>
 
92
</refsect1>
 
93
 
 
94
 
 
95
<refsect1 role="desc">
 
96
<title role="desc.title">Description</title>
 
97
<para>
 
98
A <link linkend="GtkScale"><type>GtkScale</type></link> is a slider control used to select a numeric value.
 
99
To use it, you'll probably want to investigate the methods on 
 
100
its base class, <link linkend="GtkRange"><type>GtkRange</type></link>, in addition to the methods for <link linkend="GtkScale"><type>GtkScale</type></link> itself.
 
101
To set the value of a scale, you would normally use <link linkend="gtk-range-set-value"><function>gtk_range_set_value()</function></link>. 
 
102
To detect changes to the value, you would normally use the "value_changed" 
 
103
signal.
 
104
</para>
 
105
<para>
 
106
The <link linkend="GtkScale"><type>GtkScale</type></link> widget is an abstract class, used only for deriving the
 
107
subclasses <link linkend="GtkHScale"><type>GtkHScale</type></link> and <link linkend="GtkVScale"><type>GtkVScale</type></link>. To create a scale widget, 
 
108
call <link linkend="gtk-hscale-new-with-range"><function>gtk_hscale_new_with_range()</function></link> or <link linkend="gtk-vscale-new-with-range"><function>gtk_vscale_new_with_range()</function></link>.
 
109
</para>
 
110
</refsect1>
 
111
 
 
112
<refsect1 role="details">
 
113
<title role="details.title">Details</title>
 
114
<refsect2>
 
115
<title><anchor id="GtkScale-struct" role="struct"/>GtkScale</title>
 
116
<indexterm><primary>GtkScale</primary></indexterm><programlisting>typedef struct _GtkScale GtkScale;</programlisting>
 
117
<para>
 
118
The <link linkend="GtkScale-struct"><type>GtkScale</type></link> struct contains the following fields.
 
119
(These fields should be considered read-only. They should never be set by
 
120
an application.)
 
121
 
 
122
<informaltable pgwide="1" frame="none" role="struct">
 
123
<tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
 
124
<tbody>
 
125
 
 
126
<row>
 
127
<entry><link linkend="guint"><type>guint</type></link> <structfield>draw_value</structfield>;</entry>
 
128
<entry>non-zero if the scale's current value is displayed next to the
 
129
slider.</entry>
 
130
</row>
 
131
 
 
132
<row>
 
133
<entry><link linkend="guint"><type>guint</type></link> <structfield>value_pos</structfield>;</entry>
 
134
<entry>the position in which the textual value is displayed, selected from
 
135
<link linkend="GtkPositionType"><type>GtkPositionType</type></link>.</entry>
 
136
</row>
 
137
 
 
138
</tbody></tgroup></informaltable>
 
139
</para></refsect2>
 
140
<refsect2>
 
141
<title><anchor id="gtk-scale-set-digits" role="function"/>gtk_scale_set_digits ()</title>
 
142
<indexterm><primary>gtk_scale_set_digits</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_scale_set_digits                (<link linkend="GtkScale">GtkScale</link> *scale,
 
143
                                                         <link linkend="gint">gint</link> digits);</programlisting>
 
144
<para>
 
145
Sets the number of decimal places that are displayed in the value.  Also causes
 
146
the value of the adjustment to be rounded off to this number of digits, so the
 
147
retrieved value matches the value the user saw.
 
148
</para><variablelist role="params">
 
149
<varlistentry><term><parameter>scale</parameter>&nbsp;:</term>
 
150
<listitem><simpara>a <link linkend="GtkScale"><type>GtkScale</type></link>.
 
151
</simpara></listitem></varlistentry>
 
152
<varlistentry><term><parameter>digits</parameter>&nbsp;:</term>
 
153
<listitem><simpara>the number of decimal places to display, e.g. use 1 to display 1.0,
 
154
2 to display 1.00 etc.
 
155
 
 
156
 
 
157
</simpara></listitem></varlistentry>
 
158
</variablelist></refsect2>
 
159
<refsect2>
 
160
<title><anchor id="gtk-scale-set-draw-value" role="function"/>gtk_scale_set_draw_value ()</title>
 
161
<indexterm><primary>gtk_scale_set_draw_value</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_scale_set_draw_value            (<link linkend="GtkScale">GtkScale</link> *scale,
 
162
                                                         <link linkend="gboolean">gboolean</link> draw_value);</programlisting>
 
163
<para>
 
164
Specifies whether the current value is displayed as a string next to the
 
165
slider.
 
166
</para><variablelist role="params">
 
167
<varlistentry><term><parameter>scale</parameter>&nbsp;:</term>
 
168
<listitem><simpara>a <link linkend="GtkScale"><type>GtkScale</type></link>.
 
169
</simpara></listitem></varlistentry>
 
170
<varlistentry><term><parameter>draw_value</parameter>&nbsp;:</term>
 
171
<listitem><simpara>a boolean.
 
172
 
 
173
 
 
174
</simpara></listitem></varlistentry>
 
175
</variablelist></refsect2>
 
176
<refsect2>
 
177
<title><anchor id="gtk-scale-set-value-pos" role="function"/>gtk_scale_set_value_pos ()</title>
 
178
<indexterm><primary>gtk_scale_set_value_pos</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_scale_set_value_pos             (<link linkend="GtkScale">GtkScale</link> *scale,
 
179
                                                         <link linkend="GtkPositionType">GtkPositionType</link> pos);</programlisting>
 
180
<para>
 
181
Sets the position in which the current value is displayed.
 
182
</para><variablelist role="params">
 
183
<varlistentry><term><parameter>scale</parameter>&nbsp;:</term>
 
184
<listitem><simpara>a <link linkend="GtkScale"><type>GtkScale</type></link>.
 
185
</simpara></listitem></varlistentry>
 
186
<varlistentry><term><parameter>pos</parameter>&nbsp;:</term>
 
187
<listitem><simpara>the position in which the current value is displayed.
 
188
 
 
189
 
 
190
</simpara></listitem></varlistentry>
 
191
</variablelist></refsect2>
 
192
<refsect2>
 
193
<title><anchor id="gtk-scale-get-digits" role="function"/>gtk_scale_get_digits ()</title>
 
194
<indexterm><primary>gtk_scale_get_digits</primary></indexterm><programlisting><link linkend="gint">gint</link>                gtk_scale_get_digits                (<link linkend="GtkScale">GtkScale</link> *scale);</programlisting>
 
195
<para>
 
196
Gets the number of decimal places that are displayed in the value.
 
197
</para><variablelist role="params">
 
198
<varlistentry><term><parameter>scale</parameter>&nbsp;:</term>
 
199
<listitem><simpara>a <link linkend="GtkScale"><type>GtkScale</type></link>.
 
200
</simpara></listitem></varlistentry>
 
201
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>the number of decimal places that are displayed.
 
202
 
 
203
 
 
204
</simpara></listitem></varlistentry>
 
205
</variablelist></refsect2>
 
206
<refsect2>
 
207
<title><anchor id="gtk-scale-get-draw-value" role="function"/>gtk_scale_get_draw_value ()</title>
 
208
<indexterm><primary>gtk_scale_get_draw_value</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_scale_get_draw_value            (<link linkend="GtkScale">GtkScale</link> *scale);</programlisting>
 
209
<para>
 
210
Returns whether the current value is displayed as a string next to the
 
211
slider.
 
212
</para><variablelist role="params">
 
213
<varlistentry><term><parameter>scale</parameter>&nbsp;:</term>
 
214
<listitem><simpara>a <link linkend="GtkScale"><type>GtkScale</type></link>.
 
215
</simpara></listitem></varlistentry>
 
216
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>whether the current value is displayed as a string.
 
217
 
 
218
 
 
219
</simpara></listitem></varlistentry>
 
220
</variablelist></refsect2>
 
221
<refsect2>
 
222
<title><anchor id="gtk-scale-get-value-pos" role="function"/>gtk_scale_get_value_pos ()</title>
 
223
<indexterm><primary>gtk_scale_get_value_pos</primary></indexterm><programlisting><link linkend="GtkPositionType">GtkPositionType</link>     gtk_scale_get_value_pos             (<link linkend="GtkScale">GtkScale</link> *scale);</programlisting>
 
224
<para>
 
225
Gets the position in which the current value is displayed.
 
226
</para><variablelist role="params">
 
227
<varlistentry><term><parameter>scale</parameter>&nbsp;:</term>
 
228
<listitem><simpara>a <link linkend="GtkScale"><type>GtkScale</type></link>.
 
229
</simpara></listitem></varlistentry>
 
230
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>the position in which the current value is displayed.
 
231
 
 
232
 
 
233
</simpara></listitem></varlistentry>
 
234
</variablelist></refsect2>
 
235
<refsect2>
 
236
<title><anchor id="gtk-scale-get-layout" role="function" condition="since:2.4"/>gtk_scale_get_layout ()</title>
 
237
<indexterm role="2.4"><primary>gtk_scale_get_layout</primary></indexterm><programlisting><link linkend="PangoLayout">PangoLayout</link>*        gtk_scale_get_layout                (<link linkend="GtkScale">GtkScale</link> *scale);</programlisting>
 
238
<para>
 
239
Gets the <link linkend="PangoLayout"><type>PangoLayout</type></link> used to display the scale. The returned object
 
240
is owned by the scale so does not need to be freed by the caller.</para>
 
241
<para>
 
242
 
 
243
</para><variablelist role="params">
 
244
<varlistentry><term><parameter>scale</parameter>&nbsp;:</term>
 
245
<listitem><simpara> A <link linkend="GtkScale"><type>GtkScale</type></link>
 
246
</simpara></listitem></varlistentry>
 
247
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the <link linkend="PangoLayout"><type>PangoLayout</type></link> for this scale, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the draw_value property
 
248
   is <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>.
 
249
  
 
250
</simpara></listitem></varlistentry>
 
251
</variablelist><para role="since">Since  2.4
 
252
</para></refsect2>
 
253
<refsect2>
 
254
<title><anchor id="gtk-scale-get-layout-offsets" role="function" condition="since:2.4"/>gtk_scale_get_layout_offsets ()</title>
 
255
<indexterm role="2.4"><primary>gtk_scale_get_layout_offsets</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_scale_get_layout_offsets        (<link linkend="GtkScale">GtkScale</link> *scale,
 
256
                                                         <link linkend="gint">gint</link> *x,
 
257
                                                         <link linkend="gint">gint</link> *y);</programlisting>
 
258
<para>
 
259
Obtains the coordinates where the scale will draw the <link linkend="PangoLayout"><type>PangoLayout</type></link>
 
260
representing the text in the scale. Remember
 
261
when using the <link linkend="PangoLayout"><type>PangoLayout</type></link> function you need to convert to
 
262
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>. 
 
263
</para>
 
264
<para>
 
265
If the draw_value property is <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>, the return values are 
 
266
undefined.</para>
 
267
<para>
 
268
 
 
269
</para><variablelist role="params">
 
270
<varlistentry><term><parameter>scale</parameter>&nbsp;:</term>
 
271
<listitem><simpara> a <link linkend="GtkScale"><type>GtkScale</type></link>
 
272
</simpara></listitem></varlistentry>
 
273
<varlistentry><term><parameter>x</parameter>&nbsp;:</term>
 
274
<listitem><simpara> location to store X offset of layout, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
 
275
</simpara></listitem></varlistentry>
 
276
<varlistentry><term><parameter>y</parameter>&nbsp;:</term>
 
277
<listitem><simpara> location to store Y offset of layout, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
 
278
</simpara></listitem></varlistentry>
 
279
</variablelist><para role="since">Since  2.4
 
280
</para></refsect2>
 
281
 
 
282
</refsect1>
 
283
<refsect1 role="property_details">
 
284
<title role="property_details.title">Property Details</title>
 
285
<refsect2><title><anchor id="GtkScale--digits"/>The &quot;<literal>digits</literal>&quot; property</title>
 
286
<indexterm><primary>GtkScale:digits</primary></indexterm><programlisting>  &quot;digits&quot;                   <link linkend="gint">gint</link>                  : Read / Write</programlisting>
 
287
<para>The number of decimal places that are displayed in the value.</para><para>Allowed values: [-1,64]</para>
 
288
<para>Default value: 1</para>
 
289
</refsect2>
 
290
<refsect2><title><anchor id="GtkScale--draw-value"/>The &quot;<literal>draw-value</literal>&quot; property</title>
 
291
<indexterm><primary>GtkScale:draw-value</primary></indexterm><programlisting>  &quot;draw-value&quot;               <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
 
292
<para>Whether the current value is displayed as a string next to the slider.</para><para>Default value: TRUE</para>
 
293
</refsect2>
 
294
<refsect2><title><anchor id="GtkScale--value-pos"/>The &quot;<literal>value-pos</literal>&quot; property</title>
 
295
<indexterm><primary>GtkScale:value-pos</primary></indexterm><programlisting>  &quot;value-pos&quot;                <link linkend="GtkPositionType">GtkPositionType</link>       : Read / Write</programlisting>
 
296
<para>The position in which the current value is displayed.</para><para>Default value: GTK_POS_TOP</para>
 
297
</refsect2>
 
298
 
 
299
</refsect1>
 
300
<refsect1 role="style_properties_details">
 
301
<title role="style_properties_details.title">Style Property Details</title>
 
302
<refsect2><title><anchor id="GtkScale--slider-length"/>The &quot;<literal>slider-length</literal>&quot; style property</title>
 
303
<indexterm><primary>GtkScale:slider-length</primary></indexterm><programlisting>  &quot;slider-length&quot;            <link linkend="gint">gint</link>                  : Read</programlisting>
 
304
<para>Length of scale's slider.</para><para>Allowed values: &gt;= 0</para>
 
305
<para>Default value: 31</para>
 
306
</refsect2>
 
307
<refsect2><title><anchor id="GtkScale--value-spacing"/>The &quot;<literal>value-spacing</literal>&quot; style property</title>
 
308
<indexterm><primary>GtkScale:value-spacing</primary></indexterm><programlisting>  &quot;value-spacing&quot;            <link linkend="gint">gint</link>                  : Read</programlisting>
 
309
<para>Space between value text and the slider/trough area.</para><para>Allowed values: &gt;= 0</para>
 
310
<para>Default value: 2</para>
 
311
</refsect2>
 
312
 
 
313
</refsect1>
 
314
 
 
315
<refsect1 role="signals">
 
316
<title role="signals.title">Signal Details</title>
 
317
<refsect2><title><anchor id="GtkScale-format-value"/>The &quot;format-value&quot; signal</title>
 
318
<indexterm><primary>GtkScale::format-value</primary></indexterm><programlisting><link linkend="gchar">gchar</link>*              user_function                      (<link linkend="GtkScale">GtkScale</link> *scale,
 
319
                                                        <link linkend="gdouble">gdouble</link>   arg1,
 
320
                                                        <link linkend="gpointer">gpointer</link>  user_data)      : Run Last</programlisting>
 
321
<para>
 
322
Signal which allows you to change how the scale value is displayed.  Connect a
 
323
signal handler which returns an allocated string representing <parameter>value</parameter>.
 
324
That string will then be used to display the scale's value.
 
325
Here's an example signal handler which displays a value 1.0 as
 
326
with "--&gt;1.0&lt;--".
 
327
<informalexample><programlisting>
 
328
static gchar*
 
329
format_value_callback (GtkScale *scale,
 
330
                       gdouble   value)
 
331
{
 
332
  return g_strdup_printf ("--&gt;&percnt;0.*g&lt;--",
 
333
                          gtk_scale_get_digits (scale), value);
 
334
}
 
335
</programlisting></informalexample>
 
336
</para><variablelist role="params">
 
337
<varlistentry><term><parameter>scale</parameter>&nbsp;:</term>
 
338
<listitem><simpara>the object which received the signal.
 
339
</simpara></listitem></varlistentry>
 
340
<varlistentry><term><parameter>arg1</parameter>&nbsp;:</term>
 
341
<listitem><simpara>
 
342
</simpara></listitem></varlistentry>
 
343
<varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
 
344
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
 
345
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>allocated string representing <parameter>value</parameter>
 
346
</simpara></listitem></varlistentry>
 
347
</variablelist></refsect2>
 
348
</refsect1>
 
349
 
 
350
 
 
351
 
 
352
</refentry>