Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > e40b0b2b839eccdb3c85993a7b738115 > files > 5

gtkmm-documentation-3.24.0-1.mga7.noarch.rpm

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter 14. Adjustments</title>
<link rel="stylesheet" type="text/css" href="style.css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="Programming with gtkmm 3">
<link rel="up" href="index.html" title="Programming with gtkmm 3">
<link rel="prev" href="toolpalette-example.html" title="ToolPalette Example">
<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 14. Adjustments</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="toolpalette-example.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">
<div class="titlepage"><div><div><h1 class="title">
<a name="chapter-adjustment"></a>Chapter 14. Adjustments</h1></div></div></div>
<div class="toc">
<p><b>Table of Contents</b></p>
<ul class="toc">
<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 6. 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">value_changed</code> signal. You can then use the
<code class="methodname">get_value()</code> method to discover the new value.
</p>
<div class="sect1">
<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> is created by its
<code class="methodname">create()</code> method which is as follows:
</p>
<pre class="programlisting">Glib::RefPtr&lt;Gtk::Adjustment&gt; Gtk::Adjustment::create(
  double value,
  double lower,
  double upper,
  double step_increment = 1,
  double page_increment = 10,
  double 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 specify 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 bottommost or rightmost coordinate in a panning
widget's child.

</p>
</div>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="toolpalette-example.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">ToolPalette Example </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>