File: classGtk_1_1TreeModelColumnRecord.html

package info (click to toggle)
gtkmm2.4 1%3A2.12.7-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 97,528 kB
  • ctags: 33,749
  • sloc: xml: 121,487; cpp: 17,100; sh: 8,982; makefile: 1,150; perl: 161
file content (177 lines) | stat: -rw-r--r-- 11,337 bytes parent folder | download
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>gtkmm 2.4: Gtk::TreeModelColumnRecord Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#ffffff">
<table border="0" width="100%">
<tr>
    <td width="10%" height="40"><img src="../../images/gtkmm_logo.gif" alt="logo" border="0" width="100%" height="100%"/></td>
    <td width="90%" height="40"><img src="../../images/top.gif" alt="top" width="100%" height="40"/></td>
</tr>
</table>
<center>
  <a class="qindex" href="../../index.html">Main Page</a> &nbsp;
  <a href="group__Widgets.html">Widgets</a> &nbsp;
  <a class="qindex" href="namespaces.html"> Namespaces</a> &nbsp;
  <a href="../../tutorial/html/index.html"> Book</a> &nbsp;
</center>
<hr width="100%"/>
<!-- begin main content -->
<div id="content">
<!-- Generated by Doxygen 1.5.1 -->
<div class="nav">
<a class="el" href="namespaceGtk.html">Gtk</a>::<a class="el" href="classGtk_1_1TreeModelColumnRecord.html">TreeModelColumnRecord</a></div>
<h1>Gtk::TreeModelColumnRecord Class Reference<br>
<small>
[<a class="el" href="group__TreeView.html">TreeView Classes</a>]</small>
</h1><!-- doxytag: class="Gtk::TreeModelColumnRecord" -->Inheritance diagram for Gtk::TreeModelColumnRecord:<p><center><img src="classGtk_1_1TreeModelColumnRecord__inherit__graph.png" border="0" usemap="#Gtk_1_1TreeModelColumnRecord__inherit__map" alt="Inheritance graph"></center>
<map name="Gtk_1_1TreeModelColumnRecord__inherit__map">
<area href="classGtk_1_1ComboBoxEntryText_1_1TextModelColumns.html" shape="rect" coords="5,84,312,110" alt="">
<area href="classGtk_1_1ComboBoxText_1_1TextModelColumns.html" shape="rect" coords="336,84,611,110" alt="">
<area href="classGtk_1_1ListViewText_1_1TextModelColumns.html" shape="rect" coords="635,84,891,110" alt="">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classGtk_1_1TreeModelColumnRecord-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
Typedefed as <a class="el" href="classGtk_1_1TreeModel.html#58f10daabaa507b4c2473c9d1b6fa584">TreeModel::ColumnRecord</a>. 
<p>
Keeps a record of <a class="el" href="classGtk_1_1TreeModelColumn.html">TreeModelColumns</a>.<p>
ColumnRecord objects are used to setup a new instance of a <a class="el" href="classGtk_1_1TreeModel.html">TreeModel</a> (or rather, a new instance of an implementation of the model, such as <a class="el" href="classGtk_1_1ListStore.html">Gtk::ListStore</a> or <a class="el" href="classGtk_1_1TreeStore.html">Gtk::TreeStore</a>). It is convenient to do that by deriving from <a class="el" href="classGtk_1_1TreeModel.html#58f10daabaa507b4c2473c9d1b6fa584">TreeModel::ColumnRecord</a>: <div class="fragment"><pre class="fragment"> <span class="keyword">class </span>MyModelColumns : <span class="keyword">public</span> Gtk::TreeModel::ColumnRecord
 {
 <span class="keyword">public</span>:
   <a class="code" href="classGtk_1_1TreeModelColumn.html">Gtk::TreeModelColumn&lt;Glib::ustring&gt;</a>                filename;
   <a class="code" href="classGtk_1_1TreeModelColumn.html">Gtk::TreeModelColumn&lt;Glib::ustring&gt;</a>                description;
   <a class="code" href="classGtk_1_1TreeModelColumn.html">Gtk::TreeModelColumn&lt; Glib::RefPtr&lt;Gdk::Pixbuf&gt;</a> &gt;  thumbnail;

   MyModelColumns() { <a class="code" href="classGtk_1_1TreeModelColumnRecord.html#7084fc10fa1abf0d7317558b8462559f">add</a>(filename); <a class="code" href="classGtk_1_1TreeModelColumnRecord.html#7084fc10fa1abf0d7317558b8462559f">add</a>(description); <a class="code" href="classGtk_1_1TreeModelColumnRecord.html#7084fc10fa1abf0d7317558b8462559f">add</a>(thumbnail); }
 };
</pre></div><p>
Whether or not you derive your own ColumnRecord, you need to add the <a class="el" href="classGtk_1_1TreeModelColumn.html">TreeModelColumns</a> to the ColumnRecord with the <a class="el" href="classGtk_1_1TreeModelColumnRecord.html#7084fc10fa1abf0d7317558b8462559f">add()</a> method.<p>
A ColumnRecord instance, such as an instance of <code>MyModelColumns</code> should then be passed to <a class="el" href="classGtk_1_1ListStore.html#aa6c530560f66872482a0650739276c5">ListStore::create()</a> or <a class="el" href="classGtk_1_1TreeStore.html#65fc563bfbef2f1a31028cd33ff228c0">TreeStore::create()</a>. The <a class="el" href="classGtk_1_1TreeModelColumn.html">TreeModelColumns</a>, such as the members <code>filename</code>, <code>description</code> and <code>thumbnail</code> can then be used with <a class="el" href="classGtk_1_1TreeRow.html#dbb3433651455b7ecf0a07b7012ecf17">Gtk::TreeRow::operator[]()</a> to specify the column you're interested in.<p>
Neither <a class="el" href="classGtk_1_1TreeModel.html#58f10daabaa507b4c2473c9d1b6fa584">TreeModel::ColumnRecord</a> nor the <a class="el" href="classGtk_1_1TreeModelColumn.html">TreeModelColumns</a> contain any real data -- they merely describe what C++ type is stored in which column of a <a class="el" href="classGtk_1_1TreeModel.html">TreeModel</a>, and save you from having to repeat that type information in several places.<p>
Thus you may use a statically allocated <a class="el" href="classGtk_1_1TreeModel.html#58f10daabaa507b4c2473c9d1b6fa584">TreeModel::ColumnRecord</a> (as long as you make sure it's instantiated after <a class="el" href="classGtk_1_1Main.html">Gtk::Main</a>), even when creating multiple models from it. However, it is very difficult to specify the sequence of allocation of static objects, so this should probably be avoided. 
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1TreeModelColumnRecord.html#7084fc10fa1abf0d7317558b8462559f">add</a> (<a class="el" href="classGtk_1_1TreeModelColumnBase.html">TreeModelColumnBase</a>&amp; column)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Adds a <a class="el" href="classGtk_1_1TreeModelColumn.html">TreeModelColumn</a> to this record.  <a href="#7084fc10fa1abf0d7317558b8462559f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1TreeModelColumnRecord.html#68a155c4f306f46985e8ac96f73cb5be">size</a> () const</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1TreeModelColumnRecord.html#f0c1c552400694ad0d7e5695f8868d78">TreeModelColumnRecord</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">const GType*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1TreeModelColumnRecord.html#b91e162d1826310baeed8859fe3148ff">types</a> () const</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1TreeModelColumnRecord.html#3ebe61558fecbcf761ee01f5ec8c0312">~TreeModelColumnRecord</a> ()</td></tr>

</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="f0c1c552400694ad0d7e5695f8868d78"></a><!-- doxytag: member="Gtk::TreeModelColumnRecord::TreeModelColumnRecord" ref="f0c1c552400694ad0d7e5695f8868d78" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Gtk::TreeModelColumnRecord::TreeModelColumnRecord           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

</div>
</div><p>
<a class="anchor" name="3ebe61558fecbcf761ee01f5ec8c0312"></a><!-- doxytag: member="Gtk::TreeModelColumnRecord::~TreeModelColumnRecord" ref="3ebe61558fecbcf761ee01f5ec8c0312" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual Gtk::TreeModelColumnRecord::~TreeModelColumnRecord           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="7084fc10fa1abf0d7317558b8462559f"></a><!-- doxytag: member="Gtk::TreeModelColumnRecord::add" ref="7084fc10fa1abf0d7317558b8462559f" args="(TreeModelColumnBase &amp;column)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Gtk::TreeModelColumnRecord::add           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classGtk_1_1TreeModelColumnBase.html">TreeModelColumnBase</a>&amp;&nbsp;</td>
          <td class="paramname"> <em>column</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Adds a <a class="el" href="classGtk_1_1TreeModelColumn.html">TreeModelColumn</a> to this record. 
<p>
<a class="el" href="classGtk_1_1TreeModelColumnRecord.html#7084fc10fa1abf0d7317558b8462559f">add()</a> not only registers the <em>column</em>, but also assigns a column index to it. Once registered, the <a class="el" href="classGtk_1_1TreeModelColumn.html">TreeModelColumn</a> is final, and you're free to pass it around by value. 
</div>
</div><p>
<a class="anchor" name="68a155c4f306f46985e8ac96f73cb5be"></a><!-- doxytag: member="Gtk::TreeModelColumnRecord::size" ref="68a155c4f306f46985e8ac96f73cb5be" args="() const" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int Gtk::TreeModelColumnRecord::size           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

</div>
</div><p>
<a class="anchor" name="b91e162d1826310baeed8859fe3148ff"></a><!-- doxytag: member="Gtk::TreeModelColumnRecord::types" ref="b91e162d1826310baeed8859fe3148ff" args="() const" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const GType* Gtk::TreeModelColumnRecord::types           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="treemodelcolumn_8h.html">treemodelcolumn.h</a></ul>
</div>
<!-- end main content -->

<hr><address><small>
Generated for gtkmm 2.4 by <a href="http://www.doxygen.org/index.html">
Doxygen</a> 1.5.1 &copy;&nbsp;1997-2001</small></address>
</body>
</html>