This file is indexed.

/usr/share/doc/python-gtk2-tutorial/html/sec-AdjustmentInternals.html is in python-gtk2-tutorial 2.4-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 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
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>7.3. Adjustment Internals</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="PyGTK 2.0 Tutorial"><link rel="up" href="ch-Adjustments.html" title="Chapter 7. Adjustments"><link rel="previous" href="sec-UsingAdjustmentsTheEasyWay.html" title="7.2. Using Adjustments the Easy Way"><link rel="next" href="ch-RangeWidgets.html" title="Chapter 8. Range Widgets"></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">7.3. Adjustment Internals</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="sec-UsingAdjustmentsTheEasyWay.html">Prev</a> </td><th width="60%" align="center">Chapter 7. Adjustments</th><td width="20%" align="right"> <a accesskey="n" href="ch-RangeWidgets.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sec-AdjustmentInternals"></a>7.3. Adjustment Internals</h2></div></div><div></div></div><p>Ok, you say, that's nice, but what if I want to create my own
handlers to respond when the user adjusts a range widget or a spin button,
and how do I get at the value of the adjustment in these handlers? To answer
these questions and more, let's start by taking a look at the attributes of
a <tt class="classname">gtk.Adjustment</tt> itself:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  lower
  upper
  value
  step_increment
  page_increment
  page_size
</pre></td></tr></table><p>Given a <tt class="classname">gtk.Adjustment</tt> instance
<i class="parameter"><tt>adj</tt></i>, each of the attributes are retrieved or set by
<i class="parameter"><tt>adj.lower</tt></i>, <i class="parameter"><tt>adj.value</tt></i>,
etc.</p><p>Since, when you set the value of an adjustment, you generally
want the change to be reflected by every widget that uses this adjustment,
PyGTK provides a method to do this:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  adjustment.set_value(<b class="parameter"><tt>value</tt></b>)
</pre></td></tr></table><p>As mentioned earlier, <tt class="classname">Adjustment</tt> is a
subclass of <tt class="classname">Object</tt> just like all the various widgets,
and thus it is able to emit signals. This is, of course, why updates happen
automagically when you share an adjustment object between a scrollbar and
another adjustable widget; all adjustable widgets connect signal handlers to
their adjustment's value_changed signal, as can your program. Here's the
definition of this signal callback:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  def value_changed(adjustment):
</pre></td></tr></table><p>The various widgets that use the
<tt class="classname">Adjustment</tt> object will emit this signal on an
adjustment whenever they change its value. This happens both when user input
causes the slider to move on a range widget, as well as when the program
explicitly changes the value with the <tt class="methodname">set_value</tt>()
method. So, for example, if you have a scale widget, and you want to change
the rotation of a picture whenever its value changes, you would create a
callback like this:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  def cb_rotate_picture(adj, picture):
      set_picture_rotation (picture, adj.value)
  ...
</pre></td></tr></table><p>and connect it to the scale widget's adjustment like
this:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  adj.connect("value_changed", cb_rotate_picture, picture)
</pre></td></tr></table><p>What about when a widget reconfigures the
<i class="parameter"><tt>upper</tt></i> or <i class="parameter"><tt>lower</tt></i> fields of its
adjustment, such as when a user adds more text to a text widget? In this
case, it emits the changed signal, which looks like this:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  def changed(adjustment):
</pre></td></tr></table><p><tt class="classname">Range</tt> widgets typically connect a handler
to this signal, which changes their appearance to reflect the change - for
example, the size of the slider in a scrollbar will grow or shrink in
inverse proportion to the difference between the lower and upper values of
its adjustment.</p><p>You probably won't ever need to attach a handler to this signal,
unless you're writing a new type of range widget. However, if you change any
of the values in a <tt class="classname">Adjustment</tt> directly, you should
emit this signal on it to reconfigure whatever widgets are using it, like
this:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  adjustment.emit("changed")
</pre></td></tr></table></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="sec-UsingAdjustmentsTheEasyWay.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch-Adjustments.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch-RangeWidgets.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">7.2. Using Adjustments the Easy Way </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 8. Range Widgets</td></tr></table></div></body></html>