This file is indexed.

/usr/share/doc/python-gtk2-tutorial/html/sec-TreeViews.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
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
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>14.3. TreeViews</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-TreeViewWidget.html" title="Chapter 14. Tree View Widget"><link rel="previous" href="sec-TreeModelInterface.html" title="14.2. The TreeModel Interface and Data Stores"><link rel="next" href="sec-CellRenderers.html" title="14.4. CellRenderers"></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">14.3. TreeViews</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="sec-TreeModelInterface.html">Prev</a> </td><th width="60%" align="center">Chapter 14. Tree View Widget</th><td width="20%" align="right"> <a accesskey="n" href="sec-CellRenderers.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-TreeViews"></a>14.3. TreeViews</h2></div></div><div></div></div><p>A <tt class="classname">TreeView</tt> is basically a container for the
<tt class="classname">TreeViewColumn</tt> and
<tt class="classname">CellRenderer</tt> objects that do the actual display of
the data store data. It also provides an interface to the displayed data
rows and to the characteristics that control the data display.</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sec-CreatingTreeView"></a>14.3.1. Creating a TreeView</h3></div></div><div></div></div><p>A <tt class="classname">TreeView</tt> is created using its
constructor:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  treeview = gtk.TreeView(<b class="parameter"><tt>model</tt></b>=None)
</pre></td></tr></table><p>where <i class="parameter"><tt>model</tt></i> is an object implementing the
<tt class="classname">TreeModel</tt> interface (usually a
<tt class="classname">ListStore</tt> or <tt class="classname">TreeStore</tt>). If
<i class="parameter"><tt>model</tt></i> is <tt class="literal">None</tt> or not specified the
<tt class="classname">TreeView</tt> will not be associated with a data
store.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sec-TreeViewModelAccess"></a>14.3.2. Getting and Setting the TreeView Model</h3></div></div><div></div></div><p>The tree model providing the data store for a
<tt class="classname">TreeView</tt> can be retrieved using the
<tt class="methodname">get_model</tt>() method:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  model = treeview.get_model()
</pre></td></tr></table><p>A <tt class="classname">TreeModel</tt> may be simultaneously
associated with more than one <tt class="classname">TreeView</tt> which
automatically changes its display when the <tt class="classname">TreeModel</tt>
data changes. While a <tt class="classname">TreeView</tt> always displays all of
the rows of its tree model, it may display only some of the tree model
columns. This means that two <tt class="classname">TreeView</tt>s associated
with the same <tt class="classname">TreeModel</tt> may provide completely
different views of the same data.</p><p>It's also important to realize that there is no preset relation
between the columns in a <tt class="classname">TreeView</tt> and the columns of
its <tt class="classname">TreeModel</tt>. That is, the fifth column of data in a
<tt class="classname">TreeModel</tt> may be displayed in the first column of one
<tt class="classname">TreeView</tt> and in the third column in another.</p><p>A <tt class="classname">TreeView</tt> can change its tree model
using the <tt class="methodname">set_model</tt>() method:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  treeview.set_model(<b class="parameter"><tt>model</tt></b>=None)
</pre></td></tr></table><p>where <i class="parameter"><tt>model</tt></i> is an object implementing the
<tt class="classname">TreeModel</tt> interface
(e.g. <tt class="classname">ListStore</tt> and
<tt class="classname">TreeStore</tt>). If <i class="parameter"><tt>model</tt></i> is
<tt class="literal">None</tt>, the current model is discarded.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sec-TreeViewProperties"></a>14.3.3. Setting TreeView Properties</h3></div></div><div></div></div><p>The <tt class="classname">TreeView</tt> has a number of properties
that can be managed using its methods:</p><div class="informaltable"><table cellpadding="5" width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"enable-search"</td><td valign="top">Read-Write</td><td valign="top">If <tt class="literal">TRUE</tt>, the user can search through
columns interactively. Default is <tt class="literal">TRUE</tt></td></tr><tr valign="top"><td valign="top">"expander-column"</td><td valign="top">Read-Write</td><td valign="top">The column for the expander. Default is 0</td></tr><tr valign="top"><td valign="top">"fixed-height-mode"</td><td valign="top">Read-Write</td><td valign="top">If <tt class="literal">TRUE</tt>, assume all rows have the
same height thereby speeding up display. Available in GTK+ 2.4 and
above. Default is <tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"hadjustment"</td><td valign="top">Read-Write</td><td valign="top">The horizontal <tt class="classname">Adjustment</tt> for
the widget. New one created by default.</td></tr><tr valign="top"><td valign="top">"headers-clickable"</td><td valign="top">Write</td><td valign="top">If <tt class="literal">TRUE</tt>, the column headers respond
to click events. Default is <tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"headers-visible"</td><td valign="top">Read-Write</td><td valign="top">If <tt class="literal">TRUE</tt>, show the column header
buttons. Default is <tt class="literal">TRUE</tt></td></tr><tr valign="top"><td valign="top">"model"</td><td valign="top">Read-Write</td><td valign="top">The model for the tree view. Default is
<tt class="literal">None</tt></td></tr><tr valign="top"><td valign="top">"reorderable"</td><td valign="top">Read-Write</td><td valign="top">If <tt class="literal">TRUE</tt>, the view is
reorderable. Default is <tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"rules-hint"</td><td valign="top">Read-Write</td><td valign="top">If <tt class="literal">TRUE</tt>, hint to the theme engine to
draw rows in alternating colors. Default is <tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"search-column"</td><td valign="top">Read-Write</td><td valign="top">The model column to search when searching through
code. Default is -1.</td></tr><tr valign="top"><td valign="top">"vadjustment"</td><td valign="top">Read-Write</td><td valign="top">The vertical <tt class="classname">Adjustment</tt> for the
widget. New one created by default.</td></tr></tbody></table></div><p>The corresponding methods are:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  enable_search = treeview.get_enable_search()
  treeview.set_enable_search(<b class="parameter"><tt>enable_search</tt></b>)

  column = treeview.get_expander_column()
  treeview.set_expander_column(<b class="parameter"><tt>column</tt></b>)

  hadjustment = treeview.get_hadjustment()
  treeview.set_hadjustment(<b class="parameter"><tt>adjustment</tt></b>)

  treeview.set_headers_clickable(<b class="parameter"><tt>active</tt></b>)

  headers_visible = treeview.get_headers_visible()
  treeview.set_headers_visible(<b class="parameter"><tt>headers_visible</tt></b>)

  reorderable = treeview.get_reorderable()
  treeview.set_reorderable(<b class="parameter"><tt>reorderable</tt></b>)

  riles_hint = treeview.get_rules_hint()
  treeview.set_rules_hint(<b class="parameter"><tt>setting</tt></b>)

  column = treeview.get_search_column()
  treeview.set_search_column(<b class="parameter"><tt>column</tt></b>)

  vadjustment = treeview.get_vadjustment()
  treeview.set_vadjustment(<b class="parameter"><tt>adjustment</tt></b>)
</pre></td></tr></table><p>Most of these are obvious from the description. However, the
"enable-search" property requires the "search-column" property to be set to
the number of a valid column in the tree model. Then when the user presses
<span><b class="keycap">Control</b></span>+<span><b class="keycap">f</b></span> a
search dialog is popped up that the user can type in. The first matching row
will be automatically selected as the user types.</p><p>Likewise, the "headers-clickable" property really just sets the
"clickable" property of the underlying
<tt class="classname">TreeViewColumn</tt>s. A
<tt class="classname">TreeViewColumn</tt> will not be sortable unless the tree
model implements the <tt class="classname">TreeSortable</tt> interface and the
<tt class="classname">TreeViewColumn</tt>
<tt class="methodname">set_sort_column_id</tt>() method has been called with a
valid column number.</p><p>The "reorderable" property enables the user to reorder the
<tt class="classname">TreeView</tt> model by dragging and dropping the
<tt class="classname">TreeView</tt> rows displayed.</p><p>The "rules-hint" property should only be set if you have lots of
columns and think that alternating colors may help the user.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="sec-TreeModelInterface.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch-TreeViewWidget.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="sec-CellRenderers.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">14.2. The TreeModel Interface and Data Stores </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 14.4. CellRenderers</td></tr></table></div></body></html>