Sophie

Sophie

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

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

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Using Adjustments the Easy Way</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="chapter-adjustment.html" title="Chapter 14. Adjustments">
<link rel="prev" href="chapter-adjustment.html" title="Chapter 14. Adjustments">
<link rel="next" href="sec-adjustment-internals.html" title="Adjustment Internals">
</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">Using Adjustments the Easy Way</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="chapter-adjustment.html"><img src="icons/prev.png" alt="Prev"></a> </td>
<th width="60%" align="center">Chapter 14. Adjustments</th>
<td width="20%" align="right"> <a accesskey="n" href="sec-adjustment-internals.html"><img src="icons/next.png" alt="Next"></a>
</td>
</tr>
</table>
<hr>
</div>
<div class="sect1">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="sec-adjustments-easy"></a>Using Adjustments the Easy Way</h2></div></div></div>
<p>
The adjustable widgets can be roughly divided into those which use and
require specific units for these values, and those which treat them as
arbitrary numbers.
</p>
<p>
The group which treats the values as arbitrary numbers includes the
<code class="classname">Range</code> widgets (<code class="classname">Scrollbar</code> and
<code class="classname">Scale</code>), the <code class="classname">ScaleButton</code> widget,
and the <code class="classname">SpinButton</code> widget. These widgets  are typically
"adjusted" directly by the user with the mouse or keyboard. They will treat the
<em class="parameter"><code>lower</code></em> and <em class="parameter"><code>upper</code></em> values of an
adjustment as a range within which the user can manipulate the adjustment's
<em class="parameter"><code>value</code></em>. By default, they will only modify the
<em class="parameter"><code>value</code></em> of an adjustment.
</p>
<p>
The other group includes the <code class="classname">Viewport</code> widget and the
<code class="classname">ScrolledWindow</code> widget. All of these widgets use pixel
values for their adjustments. These are also typically adjusted indirectly
using scrollbars. While all widgets which use adjustments can either create
their own adjustments or use ones you supply, you'll generally want to let this
particular category of widgets create its own adjustments.
</p>
<p>
If you share an adjustment object between a Scrollbar and a TextView
widget, manipulating the scrollbar will automagically adjust the TextView
widget. You can set it up like this:
</p>
<pre class="programlisting">// creates its own adjustments
Gtk::TextView textview;
// uses the newly-created adjustment for the scrollbar as well
Gtk::Scrollbar vscrollbar (textview.get_vadjustment(), Gtk::ORIENTATION_VERTICAL);</pre>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="chapter-adjustment.html"><img src="icons/prev.png" alt="Prev"></a> </td>
<td width="20%" align="center"><a accesskey="u" href="chapter-adjustment.html"><img src="icons/up.png" alt="Up"></a></td>
<td width="40%" align="right"> <a accesskey="n" href="sec-adjustment-internals.html"><img src="icons/next.png" alt="Next"></a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">Chapter 14. Adjustments </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"> Adjustment Internals</td>
</tr>
</table>
</div>
</body>
</html>