This file is indexed.

/usr/share/doc/python-gtk2-tutorial/html/sec-DetailsOfBoxes.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>4.2. Details of Boxes</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-PackingWidgets.html" title="Chapter 4. Packing Widgets"><link rel="previous" href="ch-PackingWidgets.html" title="Chapter 4. Packing Widgets"><link rel="next" href="sec-PackingDemonstrationProgram.html" title="4.3. Packing Demonstration Program"></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">4.2. Details of Boxes</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch-PackingWidgets.html">Prev</a> </td><th width="60%" align="center">Chapter 4. Packing Widgets</th><td width="20%" align="right"> <a accesskey="n" href="sec-PackingDemonstrationProgram.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-DetailsOfBoxes"></a>4.2. Details of Boxes</h2></div></div><div></div></div><p>Because of this flexibility, packing boxes in GTK can be
confusing at first. There are a lot of options, and it's not immediately
obvious how they all fit together. In the end, however, there are basically
five different styles. <a href="sec-DetailsOfBoxes.html#packbox1fig" title="Figure 4.1. Packing: Five Variations">Figure 4.1, &#8220;Packing: Five Variations&#8221;</a> illustrates the result
of running the program <a href="examples/packbox.py" target="_top"><span><b class="command">packbox.py</b></span></a> with an
argument of 1:</p><div class="figure"><a name="packbox1fig"></a><p class="title"><b>Figure 4.1. Packing: Five Variations</b></p><div class="mediaobject" align="center"><img src="figures/packbox1.png" align="middle" alt="Packing: Five Variations"></div></div><p>Each line contains one horizontal box (hbox) with several
buttons. The call to pack is shorthand for the call to pack each of the
buttons into the hbox. Each of the buttons is packed into the hbox the same
way (i.e., same arguments to the <tt class="methodname">pack_start</tt>()
method).</p><p>This is an example of the pack_start() method.</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  box.pack_start(child, expand, fill, padding)
</pre></td></tr></table><p><i class="parameter"><tt>box</tt></i> is the box you are packing the object
into; the first argument is the <i class="parameter"><tt>child</tt></i> object to be
packed. The objects will all be buttons for now, so we'll be packing buttons
into boxes.</p><p>The <i class="parameter"><tt>expand</tt></i> argument to
<tt class="methodname">pack_start</tt>() and
<tt class="methodname">pack_end</tt>() controls whether the widgets are laid
out in the box to fill in all the extra space in the box so the box is
expanded to fill the area allotted to it (<tt class="literal">True</tt>); or the
box is shrunk to just fit the widgets (<tt class="literal">False</tt>). Setting
expand to <tt class="literal">False</tt> will allow you to do right and left
justification of your widgets. Otherwise, they will all expand to fit into
the box, and the same effect could be achieved by using only one of
<tt class="methodname">pack_start</tt>() or
<tt class="methodname">pack_end</tt>().</p><p>The <i class="parameter"><tt>fill</tt></i> argument to the pack methods
control whether the extra space is allocated to the objects themselves
(<tt class="literal">True</tt>), or as extra padding in the box around these
objects (<tt class="literal">False</tt>). It only has an effect if the expand
argument is also <tt class="literal">True</tt>.</p><p>Python allows a method or function to be defined with default
argument values and argument keywords. Throughout this tutorial I'll show
the definition of the functions and methods with defaults and keywords
bolded as applicable. For example the <tt class="methodname">pack_start</tt>()
method is defined as:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  box.pack_start(<b class="parameter"><tt>child</tt></b>, <b class="parameter"><tt>expand</tt></b>=True, <b class="parameter"><tt>fill</tt></b>=True, <b class="parameter"><tt>padding</tt></b>=0)

  box.pack_end(<b class="parameter"><tt>child</tt></b>, <b class="parameter"><tt>expand</tt></b>=True, <b class="parameter"><tt>fill</tt></b>=True, <b class="parameter"><tt>padding</tt></b>=0)
</pre></td></tr></table><p><i class="parameter"><tt>child</tt></i>, <i class="parameter"><tt>expand</tt></i>,
<i class="parameter"><tt>fill</tt></i> and <i class="parameter"><tt>padding</tt></i> are keywords. The
<i class="parameter"><tt>expand</tt></i>, <i class="parameter"><tt>fill</tt></i> and
<i class="parameter"><tt>padding</tt></i> arguments have the defaults shown. The
<i class="parameter"><tt>child</tt></i> argument must be specified.</p><p>When creating a new box, the function looks like this:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  hbox = gtk.HBox(<b class="parameter"><tt>homogeneous</tt></b>=False, <b class="parameter"><tt>spacing</tt></b>=0)

  vbox = gtk.VBox(<b class="parameter"><tt>homogeneous</tt></b>=False, <b class="parameter"><tt>spacing</tt></b>=0)
</pre></td></tr></table><p>The <i class="parameter"><tt>homogeneous</tt></i> argument to
<tt class="function">gtk.HBox</tt>() and <tt class="function">gtk.VBox</tt>() controls
whether each object in the box has the same size (i.e., the same width in an
hbox, or the same height in a vbox). If it is set, the pack routines
function essentially as if the expand argument was always turned on.</p><p>What's the difference between <i class="parameter"><tt>spacing</tt></i>
(set when the box is created) and <i class="parameter"><tt>padding</tt></i> (set when
elements are packed)? Spacing is added between objects, and padding is added
on either side of an object. <a href="sec-DetailsOfBoxes.html#packbox2fig" title="Figure 4.2. Packing with Spacing and Padding">Figure 4.2, &#8220;Packing with Spacing and Padding&#8221;</a> illustrates the
difference; pass an argument of 2 to <a href="examples/packbox.py" target="_top"><span><b class="command">packbox.py</b></span></a> :</p><div class="figure"><a name="packbox2fig"></a><p class="title"><b>Figure 4.2. Packing with Spacing and Padding</b></p><div class="mediaobject" align="center"><img src="figures/packbox2.png" align="middle" alt="Packing with Spacing and Padding"></div></div><p><a href="sec-DetailsOfBoxes.html#packbox3fig" title="Figure 4.3. Packing with pack_end()">Figure 4.3, &#8220;Packing with pack_end()&#8221;</a> illustrates the use of the
<tt class="methodname">pack_end</tt>() method (pass an argument of 3 to <a href="examples/packbox.py" target="_top"><span><b class="command">packbox.py</b></span></a>). The label
"end" is packed with the <tt class="methodname">pack_end</tt>() method. It will
stick to the right edge of the window when the window is resized.</p><div class="figure"><a name="packbox3fig"></a><p class="title"><b>Figure 4.3. Packing with pack_end()</b></p><div class="mediaobject" align="center"><img src="figures/packbox3.png" align="middle" alt="Packing with pack_end()"></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch-PackingWidgets.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch-PackingWidgets.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="sec-PackingDemonstrationProgram.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 4. Packing Widgets </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 4.3. Packing Demonstration Program</td></tr></table></div></body></html>