File: chapter-adjustment.html

package info (click to toggle)
gtkmm-documentation 4.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 25,772 kB
  • sloc: cpp: 15,541; javascript: 1,208; makefile: 1,080; python: 401; xml: 106; perl: 67; sh: 8
file content (119 lines) | stat: -rw-r--r-- 4,905 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="highlight.min.css">
<script src="highlight.min.js"></script><script>
      hljs.configure({languages: ['cpp']});
      hljs.highlightAll();
    </script><title>Chapter 16. Adjustments</title>
<link rel="stylesheet" type="text/css" href="style.css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="Programming with gtkmm 4">
<link rel="up" href="index.html" title="Programming with gtkmm 4">
<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 16. 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">
<div class="titlepage"><div><div><h1 class="title">
<a name="chapter-adjustment"></a>Chapter 16. Adjustments</h1></div></div></div>
<div class="toc">
<p><b>Table of Contents</b></p>
<ul class="toc">
<li><span class="section"><a href="chapter-adjustment.html#sec-creating-adjustment">Creating an Adjustment</a></span></li>
<li><span class="section"><a href="sec-adjustments-easy.html">Using Adjustments the Easy Way</a></span></li>
<li><span class="section"><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 7. 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="section">
<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"><code class="code">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);</code></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="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>