1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Scale Widgets</title><meta name="generator" content="DocBook XSL Stylesheets V1.64.1"><link rel="home" href="index.html" title="Programming with gtkmm2"><link rel="up" href="ch05.html" title="Chapter5.Range Widgets"><link rel="previous" href="ch05.html" title="Chapter5.Range Widgets"><link rel="next" href="ch05s03.html" title="Update Policies"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Scale Widgets</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch05.html">Prev</a></td><th width="60%" align="center">Chapter5.Range Widgets</th><td width="20%" align="right"><a accesskey="n" href="ch05s03.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2503904"></a>Scale Widgets</h2></div></div><div></div></div><p>
<tt class="literal">Gtk::Scale</tt> widgets (or "sliders") allow the user to
visually select and manipulate a value within a specific range. You
might use one, for instance, to adjust the
magnification level on a zoomed preview of a picture, or to control
the brightness of a colour, or to specify the number of minutes of
inactivity before a screensaver takes over the screen.
</p><p>
As with <tt class="literal">Scrollbars</tt>, there are separate widget types for horizontal and
vertical widgets - <tt class="literal">Gtk::HScale</tt> and <tt class="literal">Gtk::VScale</tt>. The default constructors create an <tt class="literal">Adjustment</tt> with all of its values set to <tt class="literal">0.0</tt>. This isn't useful so you will need to set some <tt class="literal">Adjustment</tt> details to get meaningful behaviour.
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2503966"></a>Useful methods</h3></div></div><div></div></div><p>
<tt class="literal">Scale</tt> widgets can display their current value as a number next to the
trough. By default they show the value, but you can change
this with the <tt class="literal">set_draw_value()</tt> method.
</p><p>
The value displayed by a scale widget is rounded to one decimal point
by default, as is the <tt class="literal">value</tt> field in its <tt class="literal">Gtk::Adjustment</tt>. You can
change this with the <tt class="literal">set_digits()</tt> method.
</p><p>
Also, the value can be drawn in different positions
relative to the trough, specified by the <tt class="literal">set_value_pos()</tt> method.
</p><p><a href="../../reference/html/classGtk_1_1Scale.html" target="_top">Reference</a></p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch05.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="ch05.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="ch05s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter5.Range Widgets</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">Update Policies</td></tr></table></div></body></html>
|