Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 345aa895e80053137c21f8693106c3a0 > files > 7

gtkmm2.4-documentation-2.17.4-1mdv2010.0.noarch.rpm

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter 12. Adjustments</title>
<link rel="stylesheet" href="style.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
<link rel="home" href="index.html" title="Programming with gtkmm">
<link rel="up" href="index.html" title="Programming with gtkmm">
<link rel="prev" href="sec-menus-examples.html" title="Examples">
<link rel="next" href="sec-adjustments-easy.html" title="Using Adjustments the Easy Way">
</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">Chapter 12. Adjustments </th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="sec-menus-examples.html"><img src="icons/prev.png" alt="Prev"></a> </td>
<th width="60%" align="center"> </th>
<td width="20%" align="right"> <a accesskey="n" href="sec-adjustments-easy.html"><img src="icons/next.png" alt="Next"></a>
</td>
</tr>
</table>
<hr>
</div>
<div class="chapter" title="Chapter 12. Adjustments">
<div class="titlepage"><div><div><h2 class="title">
<a name="chapter-adjustment"></a>Chapter 12. Adjustments </h2></div></div></div>
<div class="toc">
<p><b>Table of Contents</b></p>
<ul>
<li><span class="sect1"><a href="chapter-adjustment.html#sec-creating-adjustment">Creating an Adjustment</a></span></li>
<li><span class="sect1"><a href="sec-adjustments-easy.html">Using Adjustments the Easy Way</a></span></li>
<li><span class="sect1"><a href="sec-adjustment-internals.html">Adjustment Internals</a></span></li>
</ul>
</div>
<p>
<span class="application">gtkmm</span> has various widgets that can be visually adjusted using the mouse or
the keyboard, such as the <code class="classname">Range</code> widgets (described in
the <a class="link" href="chapter-range-widgets.html" title="Chapter 5. Range Widgets">Range Widgets</a> section).  There are
also a few widgets that display some adjustable part of a larger area, such as
the <code class="classname">Viewport</code> widget. These widgets have
<code class="classname">Gtk::Adjustment</code> objects that express this common part of
their API.
</p>
<p>
So that applications can react to changes, for instance when a user moves a
scrollbar, <code class="classname">Gtk::Adjustment</code> has a
<code class="literal">changed</code> signal. You can then use the
<code class="methodname">get_changed()</code> method to discover the new value.
</p>
<div class="sect1" title="Creating an Adjustment">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="sec-creating-adjustment"></a>Creating an Adjustment</h2></div></div></div>
<p>
The <code class="classname">Gtk::Adjustment</code> constructor is as follows:
</p>
<pre class="programlisting">Gtk::Adjustment(float value,
                float lower,
                float upper,
                float step_increment = 1,
                float page_increment = 10,
                float page_size = 0);</pre>
<p>
The <em class="parameter"><code>value</code></em> argument is the initial value of the
adjustment, usually corresponding to the topmost or leftmost position of an
adjustable widget. The <em class="parameter"><code>lower</code></em> and
<em class="parameter"><code>upper</code></em> arguments specifies the possible range of values
which the adjustment can hold.  The
<em class="parameter"><code>step_increment</code></em> argument specifies the smaller of
the two increments by which the user can change the value, while the
<em class="parameter"><code>page_increment</code></em> is the larger one.  The
<em class="parameter"><code>page_size</code></em> argument usually corresponds somehow to
the visible area of a panning widget. The <em class="parameter"><code>upper</code></em> argument
is used to represent the bottom most or right most coordinate in a panning
widget's child.
TODO: Investigate the upper argument properly. There was some unclear stuff about it not always being the upper value.
</p>
</div>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="sec-menus-examples.html"><img src="icons/prev.png" alt="Prev"></a> </td>
<td width="20%" align="center"> </td>
<td width="40%" align="right"> <a accesskey="n" href="sec-adjustments-easy.html"><img src="icons/next.png" alt="Next"></a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">Examples </td>
<td width="20%" align="center"><a accesskey="h" href="index.html"><img src="icons/home.png" alt="Home"></a></td>
<td width="40%" align="right" valign="top"> Using Adjustments the Easy Way</td>
</tr>
</table>
</div>
</body>
</html>