53
53
struct <a class="link" href="GtkScale.html#GtkScale-struct" title="struct GtkScale">GtkScale</a>;
54
54
<span class="returnvalue">void</span> <a class="link" href="GtkScale.html#gtk-scale-set-digits" title="gtk_scale_set_digits ()">gtk_scale_set_digits</a> (<em class="parameter"><code><a class="link" href="GtkScale.html" title="GtkScale"><span class="type">GtkScale</span></a> *scale</code></em>,
55
<em class="parameter"><code><span class="type">gint</span> digits</code></em>);
55
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> digits</code></em>);
56
56
<span class="returnvalue">void</span> <a class="link" href="GtkScale.html#gtk-scale-set-draw-value" title="gtk_scale_set_draw_value ()">gtk_scale_set_draw_value</a> (<em class="parameter"><code><a class="link" href="GtkScale.html" title="GtkScale"><span class="type">GtkScale</span></a> *scale</code></em>,
57
<em class="parameter"><code><span class="type">gboolean</span> draw_value</code></em>);
57
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> draw_value</code></em>);
58
58
<span class="returnvalue">void</span> <a class="link" href="GtkScale.html#gtk-scale-set-value-pos" title="gtk_scale_set_value_pos ()">gtk_scale_set_value_pos</a> (<em class="parameter"><code><a class="link" href="GtkScale.html" title="GtkScale"><span class="type">GtkScale</span></a> *scale</code></em>,
59
59
<em class="parameter"><code><a class="link" href="gtk-Standard-Enumerations.html#GtkPositionType" title="enum GtkPositionType"><span class="type">GtkPositionType</span></a> pos</code></em>);
60
<span class="returnvalue">gint</span> <a class="link" href="GtkScale.html#gtk-scale-get-digits" title="gtk_scale_get_digits ()">gtk_scale_get_digits</a> (<em class="parameter"><code><a class="link" href="GtkScale.html" title="GtkScale"><span class="type">GtkScale</span></a> *scale</code></em>);
61
<span class="returnvalue">gboolean</span> <a class="link" href="GtkScale.html#gtk-scale-get-draw-value" title="gtk_scale_get_draw_value ()">gtk_scale_get_draw_value</a> (<em class="parameter"><code><a class="link" href="GtkScale.html" title="GtkScale"><span class="type">GtkScale</span></a> *scale</code></em>);
60
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> <a class="link" href="GtkScale.html#gtk-scale-get-digits" title="gtk_scale_get_digits ()">gtk_scale_get_digits</a> (<em class="parameter"><code><a class="link" href="GtkScale.html" title="GtkScale"><span class="type">GtkScale</span></a> *scale</code></em>);
61
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="GtkScale.html#gtk-scale-get-draw-value" title="gtk_scale_get_draw_value ()">gtk_scale_get_draw_value</a> (<em class="parameter"><code><a class="link" href="GtkScale.html" title="GtkScale"><span class="type">GtkScale</span></a> *scale</code></em>);
62
62
<a class="link" href="gtk-Standard-Enumerations.html#GtkPositionType" title="enum GtkPositionType"><span class="returnvalue">GtkPositionType</span></a> <a class="link" href="GtkScale.html#gtk-scale-get-value-pos" title="gtk_scale_get_value_pos ()">gtk_scale_get_value_pos</a> (<em class="parameter"><code><a class="link" href="GtkScale.html" title="GtkScale"><span class="type">GtkScale</span></a> *scale</code></em>);
63
<span class="returnvalue">PangoLayout</span> * <a class="link" href="GtkScale.html#gtk-scale-get-layout" title="gtk_scale_get_layout ()">gtk_scale_get_layout</a> (<em class="parameter"><code><a class="link" href="GtkScale.html" title="GtkScale"><span class="type">GtkScale</span></a> *scale</code></em>);
63
<a href="/usr/share/gtk-doc/html/pango/pango-Layout-Objects.html#PangoLayout"><span class="returnvalue">PangoLayout</span></a> * <a class="link" href="GtkScale.html#gtk-scale-get-layout" title="gtk_scale_get_layout ()">gtk_scale_get_layout</a> (<em class="parameter"><code><a class="link" href="GtkScale.html" title="GtkScale"><span class="type">GtkScale</span></a> *scale</code></em>);
64
64
<span class="returnvalue">void</span> <a class="link" href="GtkScale.html#gtk-scale-get-layout-offsets" title="gtk_scale_get_layout_offsets ()">gtk_scale_get_layout_offsets</a> (<em class="parameter"><code><a class="link" href="GtkScale.html" title="GtkScale"><span class="type">GtkScale</span></a> *scale</code></em>,
65
<em class="parameter"><code><span class="type">gint</span> *x</code></em>,
66
<em class="parameter"><code><span class="type">gint</span> *y</code></em>);
65
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *x</code></em>,
66
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *y</code></em>);
67
67
<span class="returnvalue">void</span> <a class="link" href="GtkScale.html#gtk-scale-add-mark" title="gtk_scale_add_mark ()">gtk_scale_add_mark</a> (<em class="parameter"><code><a class="link" href="GtkScale.html" title="GtkScale"><span class="type">GtkScale</span></a> *scale</code></em>,
68
<em class="parameter"><code><span class="type">gdouble</span> value</code></em>,
68
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> value</code></em>,
69
69
<em class="parameter"><code><a class="link" href="gtk-Standard-Enumerations.html#GtkPositionType" title="enum GtkPositionType"><span class="type">GtkPositionType</span></a> position</code></em>,
70
<em class="parameter"><code>const <span class="type">gchar</span> *markup</code></em>);
70
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *markup</code></em>);
71
71
<span class="returnvalue">void</span> <a class="link" href="GtkScale.html#gtk-scale-clear-marks" title="gtk_scale_clear_marks ()">gtk_scale_clear_marks</a> (<em class="parameter"><code><a class="link" href="GtkScale.html" title="GtkScale"><span class="type">GtkScale</span></a> *scale</code></em>);
74
74
<div class="refsect1">
75
75
<a name="GtkScale.object-hierarchy"></a><h2>Object Hierarchy</h2>
76
76
<pre class="synopsis">
78
+----GInitiallyUnowned
77
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
78
+----<a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a>
79
79
+----<a class="link" href="GtkObject.html" title="GtkObject">GtkObject</a>
80
80
+----<a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>
81
81
+----<a class="link" href="GtkRange.html" title="GtkRange">GtkRange</a>
93
93
<div class="refsect1">
94
94
<a name="GtkScale.properties"></a><h2>Properties</h2>
95
95
<pre class="synopsis">
96
"<a class="link" href="GtkScale.html#GtkScale--digits" title='The "digits" property'>digits</a>" <span class="type">gint</span> : Read / Write
97
"<a class="link" href="GtkScale.html#GtkScale--draw-value" title='The "draw-value" property'>draw-value</a>" <span class="type">gboolean</span> : Read / Write
96
"<a class="link" href="GtkScale.html#GtkScale--digits" title='The "digits" property'>digits</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> : Read / Write
97
"<a class="link" href="GtkScale.html#GtkScale--draw-value" title='The "draw-value" property'>draw-value</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write
98
98
"<a class="link" href="GtkScale.html#GtkScale--value-pos" title='The "value-pos" property'>value-pos</a>" <a class="link" href="gtk-Standard-Enumerations.html#GtkPositionType" title="enum GtkPositionType"><span class="type">GtkPositionType</span></a> : Read / Write
101
101
<div class="refsect1">
102
102
<a name="GtkScale.style-properties"></a><h2>Style Properties</h2>
103
103
<pre class="synopsis">
104
"<a class="link" href="GtkScale.html#GtkScale--s-slider-length" title='The "slider-length" style property'>slider-length</a>" <span class="type">gint</span> : Read
105
"<a class="link" href="GtkScale.html#GtkScale--s-value-spacing" title='The "value-spacing" style property'>value-spacing</a>" <span class="type">gint</span> : Read
104
"<a class="link" href="GtkScale.html#GtkScale--s-slider-length" title='The "slider-length" style property'>slider-length</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> : Read
105
"<a class="link" href="GtkScale.html#GtkScale--s-value-spacing" title='The "value-spacing" style property'>value-spacing</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> : Read
108
108
<div class="refsect1">
109
109
<a name="GtkScale.signals"></a><h2>Signals</h2>
110
110
<pre class="synopsis">
111
"<a class="link" href="GtkScale.html#GtkScale-format-value" title='The "format-value" signal'>format-value</a>" : <code class="literal">Run Last</code>
111
"<a class="link" href="GtkScale.html#GtkScale-format-value" title='The "format-value" signal'>format-value</a>" : <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS"><code class="literal">Run Last</code></a>
114
114
<div class="refsect1">
293
293
<div class="refsect2">
294
294
<a name="gtk-scale-get-layout"></a><h3>gtk_scale_get_layout ()</h3>
295
<pre class="programlisting"><span class="returnvalue">PangoLayout</span> * gtk_scale_get_layout (<em class="parameter"><code><a class="link" href="GtkScale.html" title="GtkScale"><span class="type">GtkScale</span></a> *scale</code></em>);</pre>
295
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/pango/pango-Layout-Objects.html#PangoLayout"><span class="returnvalue">PangoLayout</span></a> * gtk_scale_get_layout (<em class="parameter"><code><a class="link" href="GtkScale.html" title="GtkScale"><span class="type">GtkScale</span></a> *scale</code></em>);</pre>
297
Gets the <span class="type">PangoLayout</span> used to display the scale. The returned
297
Gets the <a href="/usr/share/gtk-doc/html/pango/pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a> used to display the scale. The returned
298
298
object is owned by the scale so does not need to be freed by
310
310
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
311
<td>the <span class="type">PangoLayout</span> for this scale,
312
or <a href="/home/mclasen/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a> if the <a class="link" href="GtkScale.html#GtkScale--draw-value" title='The "draw-value" property'><span class="type">"draw-value"</span></a> property is <code class="literal">FALSE</code>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
311
<td>the <a href="/usr/share/gtk-doc/html/pango/pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a> for this scale,
312
or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the <a class="link" href="GtkScale.html#GtkScale--draw-value" title='The "draw-value" property'><span class="type">"draw-value"</span></a> property is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
320
320
<div class="refsect2">
321
321
<a name="gtk-scale-get-layout-offsets"></a><h3>gtk_scale_get_layout_offsets ()</h3>
322
322
<pre class="programlisting"><span class="returnvalue">void</span> gtk_scale_get_layout_offsets (<em class="parameter"><code><a class="link" href="GtkScale.html" title="GtkScale"><span class="type">GtkScale</span></a> *scale</code></em>,
323
<em class="parameter"><code><span class="type">gint</span> *x</code></em>,
324
<em class="parameter"><code><span class="type">gint</span> *y</code></em>);</pre>
323
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *x</code></em>,
324
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *y</code></em>);</pre>
326
326
Obtains the coordinates where the scale will draw the
327
<span class="type">PangoLayout</span> representing the text in the scale. Remember
328
when using the <span class="type">PangoLayout</span> function you need to convert to
329
and from pixels using <code class="function">PANGO_PIXELS()</code> or <span class="type">PANGO_SCALE</span>.
327
<a href="/usr/share/gtk-doc/html/pango/pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a> representing the text in the scale. Remember
328
when using the <a href="/usr/share/gtk-doc/html/pango/pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a> function you need to convert to
329
and from pixels using <a href="/usr/share/gtk-doc/html/pango/pango-Glyph-Storage.html#PANGO-PIXELS:CAPS"><code class="function">PANGO_PIXELS()</code></a> or <a href="/usr/share/gtk-doc/html/pango/pango-Glyph-Storage.html#PANGO-SCALE:CAPS"><span class="type">PANGO_SCALE</span></a>.
332
If the <a class="link" href="GtkScale.html#GtkScale--draw-value" title='The "draw-value" property'><span class="type">"draw-value"</span></a> property is <code class="literal">FALSE</code>, the return
332
If the <a class="link" href="GtkScale.html#GtkScale--draw-value" title='The "draw-value" property'><span class="type">"draw-value"</span></a> property is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, the return
333
333
values are undefined.
335
335
<div class="variablelist"><table border="0">
344
344
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
345
<td>location to store X offset of layout, or <a href="/home/mclasen/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
345
<td>location to store X offset of layout, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
349
349
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
350
<td>location to store Y offset of layout, or <a href="/home/mclasen/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
350
<td>location to store Y offset of layout, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
358
358
<div class="refsect2">
359
359
<a name="gtk-scale-add-mark"></a><h3>gtk_scale_add_mark ()</h3>
360
360
<pre class="programlisting"><span class="returnvalue">void</span> gtk_scale_add_mark (<em class="parameter"><code><a class="link" href="GtkScale.html" title="GtkScale"><span class="type">GtkScale</span></a> *scale</code></em>,
361
<em class="parameter"><code><span class="type">gdouble</span> value</code></em>,
361
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> value</code></em>,
362
362
<em class="parameter"><code><a class="link" href="gtk-Standard-Enumerations.html#GtkPositionType" title="enum GtkPositionType"><span class="type">GtkPositionType</span></a> position</code></em>,
363
<em class="parameter"><code>const <span class="type">gchar</span> *markup</code></em>);</pre>
363
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *markup</code></em>);</pre>
365
365
Adds a mark at <em class="parameter"><code>value</code></em>.
468
468
<a name="GtkScale.signal-details"></a><h2>Signal Details</h2>
469
469
<div class="refsect2">
470
470
<a name="GtkScale-format-value"></a><h3>The <code class="literal">"format-value"</code> signal</h3>
471
<pre class="programlisting"><span class="returnvalue">gchar</span>* user_function (<a class="link" href="GtkScale.html" title="GtkScale"><span class="type">GtkScale</span></a> *scale,
472
<span class="type">gdouble</span> value,
473
<span class="type">gpointer</span> user_data) : <code class="literal">Run Last</code></pre>
471
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a>* user_function (<a class="link" href="GtkScale.html" title="GtkScale"><span class="type">GtkScale</span></a> *scale,
472
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> value,
473
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data) : <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS"><code class="literal">Run Last</code></a></pre>
475
475
Signal which allows you to change how the scale value is displayed.
476
476
Connect a signal handler which returns an allocated string representing
494
<td class="listing_code"><pre class="programlisting"><span class="keyword">static</span><span class="normal"> gchar</span><span class="symbol">*</span>
494
<td class="listing_code"><pre class="programlisting"><span class="keyword">static</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar">gchar</a></span><span class="symbol">*</span>
495
495
<span class="function">format_value_callback</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">GtkScale</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">scale</span><span class="symbol">,</span>
496
496
<span class="normal"> </span><span class="usertype">gdouble</span><span class="normal"> value</span><span class="symbol">)</span>
497
497
<span class="cbracket">{</span>
498
<span class="normal"> </span><span class="keyword">return</span><span class="normal"> </span><span class="function">g_strdup_printf</span><span class="normal"> </span><span class="symbol">(</span><span class="string">"-->%0.*g<--"</span><span class="symbol">,</span>
498
<span class="normal"> </span><span class="keyword">return</span><span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-String-Utility-Functions.html#g-strdup-printf">g_strdup_printf</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"-->%0.*g<--"</span><span class="symbol">,</span>
499
499
<span class="normal"> </span><span class="function"><a href="GtkScale.html#gtk-scale-get-digits">gtk_scale_get_digits</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">scale</span><span class="symbol">),</span><span class="normal"> value</span><span class="symbol">);</span>
500
500
<span class="normal"> </span><span class="cbracket">}</span></pre></td>