summaryrefslogtreecommitdiff
path: root/docs/reference/gtk/tmpl/gtkadjustment.sgml
blob: 2489eb451406b551da1f9baa5b90fb95d306c08b (plain)
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<!-- ##### SECTION Title ##### -->
GtkAdjustment

<!-- ##### SECTION Short_Description ##### -->
A GtkObject representing an adjustable bounded value

<!-- ##### SECTION Long_Description ##### -->
<para>
The #GtkAdjustment object represents a value which has an associated lower
and upper bound, together with step and page increments, and a page size.
It is used within several GTK+ widgets, including
#GtkSpinButton, #GtkViewport, and #GtkRange (which is a base class for
#GtkHScrollbar, #GtkVScrollbar, #GtkHScale, and #GtkVScale).
</para>
<para>
The #GtkAdjustment object does not update the value itself. Instead
it is left up to the owner of the #GtkAdjustment to control the value.
</para>
<para>
The owner of the #GtkAdjustment typically calls the
gtk_adjustment_value_changed() and gtk_adjustment_changed() functions
after changing the value and its bounds. This results in the emission of the
&quot;value_changed&quot; or &quot;changed&quot; signal respectively.
</para>

<!-- ##### SECTION See_Also ##### -->
<para>

</para>

<!-- ##### STRUCT GtkAdjustment ##### -->
<para>
The #GtkAdjustment-struct struct contains the following fields.

<informaltable pgwide="1" frame="none" role="struct">
<tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
<tbody>

<row>
<entry>#gdouble lower;</entry>
<entry>the minimum value.</entry>
</row>

<row>
<entry>#gdouble upper;</entry>
<entry>the maximum value.</entry>
</row>

<row>
<entry>#gdouble value;</entry>
<entry>the current value.</entry>
</row>

<row>
<entry>#gdouble step_increment;</entry>
<entry>the increment to use to make minor changes to the value.
In a #GtkScrollbar this increment is used when the mouse is clicked on the
arrows at the top and bottom of the scrollbar, to scroll by a small amount.
</entry>
</row>

<row>
<entry>#gdouble page_increment;</entry>
<entry>the increment to use to make major changes to the value.
In a #GtkScrollbar this increment is used when the mouse is clicked in the
trough, to scroll by a large amount.
</entry>
</row>

<row>
<entry>#gdouble page_size;</entry>
<entry>the page size.
In a #GtkScrollbar this is the size of the area which is currently visible.
</entry>
</row>

</tbody></tgroup></informaltable>

</para>


<!-- ##### FUNCTION gtk_adjustment_new ##### -->
<para>
Creates a new #GtkAdjustment.
</para>

@value: the initial value.
@lower: the minimum value.
@upper: the maximum value.
@step_increment: the step increment.
@page_increment: the page increment.
@page_size: the page size.
@Returns: a new #GtkAdjustment.


<!-- ##### FUNCTION gtk_adjustment_get_value ##### -->
<para>

</para>

@adjustment: 
@Returns: 


<!-- ##### FUNCTION gtk_adjustment_set_value ##### -->
<para>
Sets the #GtkAdjustment value. The value is clamped to lie between
<literal>adjustment-&gt;lower</literal> and
<literal>adjustment-&gt;upper</literal>.
</para>
<para>
Note that for adjustments which are used in a #GtkScrollbar, the effective
range of allowed values goes from <literal>adjustment-&gt;lower</literal> to
<literal>adjustment-&gt;upper - adjustment-&gt;page_size</literal>.
</para>

@adjustment: a #GtkAdjustment.
@value: the new value.


<!-- ##### FUNCTION gtk_adjustment_clamp_page ##### -->
<para>
Updates the #GtkAdjustment @value to ensure that the range between @lower
and @upper is in the current page (i.e. between @value and @value +
@page_size).
If the range is larger than the page size, then only the start of it will
be in the current page.
A &quot;changed&quot; signal will be emitted if the value is changed.
</para>

@adjustment: a #GtkAdjustment.
@lower: the lower value.
@upper: the upper value.


<!-- ##### FUNCTION gtk_adjustment_changed ##### -->
<para>
Emits a &quot;changed&quot; signal from the #GtkAdjustment.
This is typically called by the owner of the #GtkAdjustment after it has
changed any of the #GtkAdjustment fields other than the value.
</para>

@adjustment: 


<!-- ##### FUNCTION gtk_adjustment_value_changed ##### -->
<para>
Emits a &quot;value_changed&quot; signal from the #GtkAdjustment.
This is typically called by the owner of the #GtkAdjustment after it has
changed the #GtkAdjustment value field.
</para>

@adjustment: 


<!-- ##### SIGNAL GtkAdjustment::changed ##### -->
<para>
Emitted when one or more of the #GtkAdjustment fields have been changed,
other than the value field.
</para>

@adjustment: the object which received the signal.

<!-- ##### SIGNAL GtkAdjustment::value-changed ##### -->
<para>
Emitted when the #GtkAdjustment value field has been changed.
</para>

@adjustment: the object which received the signal.

<!-- ##### ARG GtkAdjustment:lower ##### -->
<para>

</para>

<!-- ##### ARG GtkAdjustment:page-increment ##### -->
<para>

</para>

<!-- ##### ARG GtkAdjustment:page-size ##### -->
<para>

</para>

<!-- ##### ARG GtkAdjustment:step-increment ##### -->
<para>

</para>

<!-- ##### ARG GtkAdjustment:upper ##### -->
<para>

</para>

<!-- ##### ARG GtkAdjustment:value ##### -->
<para>

</para>