/usr/share/doc/gtkmm-documentation/tutorial/html/sec-iterating-over-model-rows.html is in gtkmm-documentation 3.2.1-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 | <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Iterating over Model Rows</title>
<link rel="stylesheet" href="style.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="Programming with gtkmm 3">
<link rel="up" href="chapter-treeview.html" title="Chapter 9. The TreeView widget">
<link rel="prev" href="sec-treeview.html" title="The View">
<link rel="next" href="sec-treeview-selection.html" title="The Selection">
</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">Iterating over Model Rows</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="sec-treeview.html"><img src="icons/prev.png" alt="Prev"></a> </td>
<th width="60%" align="center">Chapter 9. The TreeView widget</th>
<td width="20%" align="right"> <a accesskey="n" href="sec-treeview-selection.html"><img src="icons/next.png" alt="Next"></a>
</td>
</tr>
</table>
<hr>
</div>
<div class="sect1" title="Iterating over Model Rows">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="sec-iterating-over-model-rows"></a>Iterating over Model Rows</h2></div></div></div>
<p>
<code class="classname">Gtk::TreeModel</code> provides a C++ Standard Library-style container of its
children, via the <code class="methodname">children()</code> method. You can use the
familiar <code class="methodname">begin()</code> and <code class="methodname">end()</code> methods
iterator incrementing, like so:
</p>
<pre class="programlisting">typedef Gtk::TreeModel::Children type_children; //minimise code length.
type_children children = refModel->children();
for(type_children::iterator iter = children.begin();
iter != children.end(); ++iter)
{
Gtk::TreeModel::Row row = *iter;
//Do something with the row - see above for set/get.
}</pre>
<div class="sect2" title="Row children">
<div class="titlepage"><div><div><h3 class="title">
<a name="treeview-row-children"></a>Row children</h3></div></div></div>
<p>
When using a <code class="classname">Gtk::TreeStore</code>, the rows can have child
rows, which can have their own children in turn. Use
<code class="methodname">Gtk::TreeModel::Row::children()</code> to get the container of child <code class="classname">Row</code>s:
</p>
<pre class="programlisting">Gtk::TreeModel::Children children = row.children();</pre>
<p>
</p>
</div>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="sec-treeview.html"><img src="icons/prev.png" alt="Prev"></a> </td>
<td width="20%" align="center"><a accesskey="u" href="chapter-treeview.html"><img src="icons/up.png" alt="Up"></a></td>
<td width="40%" align="right"> <a accesskey="n" href="sec-treeview-selection.html"><img src="icons/next.png" alt="Next"></a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">The View </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"> The Selection</td>
</tr>
</table>
</div>
</body>
</html>
|