2002-07-17 14:06:33 +00:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>NSTableColumn</title>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<a href="Gui.html">Up</a>
|
|
|
|
<br />
|
|
|
|
<h1><a name="title$NSTableColumn">NSTableColumn</a></h1>
|
|
|
|
<h3>Authors</h3>
|
|
|
|
<dl>
|
|
|
|
<dt>Nicola Pero(<a href="mailto:n.pero@mi.flashnet.it"><code>
|
|
|
|
n.pero@mi.flashnet.it
|
|
|
|
</code></a>)</dt>
|
|
|
|
<dd>
|
|
|
|
</dd>
|
|
|
|
</dl>
|
|
|
|
<p><b>Copyright:</b> (C) 1999 Free Software Foundation, Inc.</p>
|
|
|
|
<div>
|
|
|
|
<hr width="50%" align="left" />
|
|
|
|
<h3>Contents -</h3>
|
|
|
|
<ol>
|
|
|
|
<li>
|
|
|
|
<a href="#001000000000">Class Description</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#001001000000">The Column Identifier</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#001002000000">Information Stored in an NSTableColumn Object</a>
|
|
|
|
</li>
|
|
|
|
</ol>
|
|
|
|
<hr width="50%" align="left" />
|
|
|
|
</div>
|
|
|
|
<h1><a name="001000000000">Class Description</a></h1>
|
|
|
|
<p>
|
2000-11-23 11:14:44 +00:00
|
|
|
|
2002-01-28 04:50:14 +00:00
|
|
|
NSTableColumn objects represent columns in
|
|
|
|
NSTableViews.
|
2002-07-17 14:06:33 +00:00
|
|
|
</p>
|
|
|
|
<h2><a name="001001000000">The Column Identifier</a></h2>
|
|
|
|
<p>
|
|
|
|
|
|
|
|
Each NSTableColumn object is identified by an object,
|
|
|
|
called the column identifier. The reason is that,
|
|
|
|
after a column has been added to a table view, the user
|
|
|
|
might move the columns around, so there is a need to
|
|
|
|
identify the columns regardless of their position in
|
|
|
|
the table.
|
|
|
|
</p>
|
|
|
|
<p>
|
2002-04-03 16:59:43 +00:00
|
|
|
|
2002-07-17 14:06:33 +00:00
|
|
|
The identifier is typically a string describing the
|
|
|
|
column. This identifier object is never displayed to
|
|
|
|
the user ! It is only used internally by the program to
|
|
|
|
identify the column - so yes, you may use a funny
|
|
|
|
string for it and nobody will know, except people
|
|
|
|
reading the code.
|
|
|
|
</p>
|
|
|
|
<h2><a name="001002000000">
|
|
|
|
Information Stored in an NSTableColumn Object
|
|
|
|
</a></h2>
|
|
|
|
<p>
|
2002-04-03 16:59:43 +00:00
|
|
|
|
2002-07-17 14:06:33 +00:00
|
|
|
An NSTableColumn object mainly keeps information about the
|
|
|
|
width of the column, its minimum and maximum width;
|
|
|
|
whether the column can be edited or resized; and the
|
|
|
|
cells used to draw the column header and the data in
|
|
|
|
the column. You can change all these attributes of the
|
|
|
|
column by calling the appropriate methods. Please note
|
|
|
|
that the table column does not hold nor has access to
|
|
|
|
the data to be displayed in the column; this data is
|
|
|
|
maintained in the table view's data source, as
|
|
|
|
described in the NSTableView documentation. A last
|
|
|
|
hint: to set the title of a table column, ask the table
|
|
|
|
column for its header cell, and set the string value
|
|
|
|
of this header cell to the desired title.
|
|
|
|
</p>
|
|
|
|
<h2><a name="class$NSTableColumn">NSTableColumn</a> : NSObject</h2>
|
|
|
|
<blockquote>
|
|
|
|
<dl>
|
|
|
|
<dt><b>Declared in:</b></dt>
|
|
|
|
<dd>AppKit/NSTableColumn.h</dd>
|
|
|
|
</dl>
|
|
|
|
</blockquote>
|
|
|
|
<blockquote>
|
|
|
|
<dl>
|
|
|
|
<dt><b>Conforms to:</b></dt>
|
|
|
|
<dd>NSCoding</dd>
|
|
|
|
</dl>
|
|
|
|
</blockquote>
|
|
|
|
<blockquote>
|
|
|
|
<b>Standards:</b>
|
|
|
|
<ul>
|
|
|
|
<li>MacOS-X</li>
|
|
|
|
<li>OpenStep</li>
|
|
|
|
<li>GNUstep</li>
|
|
|
|
</ul>
|
|
|
|
</blockquote>
|
|
|
|
<p>
|
|
|
|
|
|
|
|
|
|
|
|
</p>
|
|
|
|
<b>Method summary</b>
|
|
|
|
<ul>
|
|
|
|
<li><a rel="gsdoc" href="NSTableColumn.html#method$NSTableColumn-dataCell">-dataCell</a></li>
|
|
|
|
<li><a rel="gsdoc" href="NSTableColumn.html#method$NSTableColumn-dataCellForRow:">-dataCellForRow:</a></li>
|
|
|
|
<li><a rel="gsdoc" href="NSTableColumn.html#method$NSTableColumn-headerCell">-headerCell</a></li>
|
|
|
|
<li><a rel="gsdoc" href="NSTableColumn.html#method$NSTableColumn-identifier">-identifier</a></li>
|
|
|
|
<li><a rel="gsdoc" href="NSTableColumn.html#method$NSTableColumn-initWithIdentifier:">-initWithIdentifier:</a></li>
|
|
|
|
<li><a rel="gsdoc" href="NSTableColumn.html#method$NSTableColumn-isEditable">-isEditable</a></li>
|
|
|
|
<li><a rel="gsdoc" href="NSTableColumn.html#method$NSTableColumn-isResizable">-isResizable</a></li>
|
|
|
|
<li><a rel="gsdoc" href="NSTableColumn.html#method$NSTableColumn-maxWidth">-maxWidth</a></li>
|
|
|
|
<li><a rel="gsdoc" href="NSTableColumn.html#method$NSTableColumn-minWidth">-minWidth</a></li>
|
|
|
|
<li><a rel="gsdoc" href="NSTableColumn.html#method$NSTableColumn-setDataCell:">-setDataCell:</a></li>
|
|
|
|
<li><a rel="gsdoc" href="NSTableColumn.html#method$NSTableColumn-setEditable:">-setEditable:</a></li>
|
|
|
|
<li><a rel="gsdoc" href="NSTableColumn.html#method$NSTableColumn-setHeaderCell:">-setHeaderCell:</a></li>
|
|
|
|
<li><a rel="gsdoc" href="NSTableColumn.html#method$NSTableColumn-setIdentifier:">-setIdentifier:</a></li>
|
|
|
|
<li><a rel="gsdoc" href="NSTableColumn.html#method$NSTableColumn-setMaxWidth:">-setMaxWidth:</a></li>
|
|
|
|
<li><a rel="gsdoc" href="NSTableColumn.html#method$NSTableColumn-setMinWidth:">-setMinWidth:</a></li>
|
|
|
|
<li><a rel="gsdoc" href="NSTableColumn.html#method$NSTableColumn-setResizable:">-setResizable:</a></li>
|
|
|
|
<li><a rel="gsdoc" href="NSTableColumn.html#method$NSTableColumn-setTableView:">-setTableView:</a></li>
|
|
|
|
<li><a rel="gsdoc" href="NSTableColumn.html#method$NSTableColumn-setWidth:">-setWidth:</a></li>
|
|
|
|
<li><a rel="gsdoc" href="NSTableColumn.html#method$NSTableColumn-sizeToFit">-sizeToFit</a></li>
|
|
|
|
<li><a rel="gsdoc" href="NSTableColumn.html#method$NSTableColumn-tableView">-tableView</a></li>
|
|
|
|
<li><a rel="gsdoc" href="NSTableColumn.html#method$NSTableColumn-width">-width</a></li>
|
|
|
|
</ul>
|
|
|
|
<hr width="50%" align="left" />
|
|
|
|
<h3><a name="method$NSTableColumn-dataCell">dataCell</a></h3>
|
|
|
|
- (<a rel="gsdoc" href="NSCell.html#class$NSCell">NSCell</a>*) <b>dataCell</b>;<br />
|
|
|
|
<p>
|
|
|
|
|
2002-04-03 16:59:43 +00:00
|
|
|
Return the cell used to display data in the column.
|
|
|
|
The default data cell is an NSTextFieldCell.
|
2002-07-17 14:06:33 +00:00
|
|
|
|
|
|
|
</p>
|
|
|
|
<hr width="25%" align="left" />
|
|
|
|
<h3><a name="method$NSTableColumn-dataCellForRow:">dataCellForRow:</a></h3>
|
|
|
|
- (<a rel="gsdoc" href="NSCell.html#class$NSCell">NSCell</a>*) <b>dataCellForRow:</b> (int)row;<br />
|
|
|
|
<p>
|
|
|
|
|
2002-04-03 16:59:43 +00:00
|
|
|
<em>Description forthcoming.</em>
|
2002-07-17 14:06:33 +00:00
|
|
|
|
|
|
|
</p>
|
|
|
|
<hr width="25%" align="left" />
|
|
|
|
<h3><a name="method$NSTableColumn-headerCell">headerCell</a></h3>
|
|
|
|
- (<a rel="gsdoc" href="NSCell.html#class$NSCell">NSCell</a>*) <b>headerCell</b>;<br />
|
|
|
|
<p>
|
|
|
|
|
2002-04-03 16:59:43 +00:00
|
|
|
Return the cell used to display the column title.
|
|
|
|
The default header cell is an NSTableHeaderCell.
|
2002-07-17 14:06:33 +00:00
|
|
|
|
|
|
|
</p>
|
|
|
|
<hr width="25%" align="left" />
|
|
|
|
<h3><a name="method$NSTableColumn-identifier">identifier</a></h3>
|
|
|
|
- (id) <b>identifier</b>;<br />
|
|
|
|
<p>
|
|
|
|
|
2002-04-03 16:59:43 +00:00
|
|
|
Return the column identifier, an object used to
|
|
|
|
identify the column. This object is usually a
|
|
|
|
string, but might be any kind of object.
|
2002-07-17 14:06:33 +00:00
|
|
|
|
|
|
|
</p>
|
|
|
|
<hr width="25%" align="left" />
|
|
|
|
<h3><a name="method$NSTableColumn-initWithIdentifier:">initWithIdentifier:</a></h3>
|
|
|
|
- (id) <b>initWithIdentifier:</b> (id)anObject;<br />
|
|
|
|
<p>
|
|
|
|
|
2002-04-03 16:59:43 +00:00
|
|
|
Initialize the column. <var>anObject</var> is an
|
|
|
|
object used to identify the column; it is usually a
|
|
|
|
string, but might be any kind of object.
|
|
|
|
<var>anObject</var> is retained.
|
2002-07-17 14:06:33 +00:00
|
|
|
|
|
|
|
</p>
|
|
|
|
<hr width="25%" align="left" />
|
|
|
|
<h3><a name="method$NSTableColumn-isEditable">isEditable</a></h3>
|
|
|
|
- (BOOL) <b>isEditable</b>;<br />
|
|
|
|
<p>
|
|
|
|
|
2002-04-03 16:59:43 +00:00
|
|
|
Return whether data displayed in the column can be
|
|
|
|
edited by the user by double-cliking on them.
|
2002-07-17 14:06:33 +00:00
|
|
|
|
|
|
|
</p>
|
|
|
|
<hr width="25%" align="left" />
|
|
|
|
<h3><a name="method$NSTableColumn-isResizable">isResizable</a></h3>
|
|
|
|
- (BOOL) <b>isResizable</b>;<br />
|
|
|
|
<p>
|
|
|
|
|
2002-04-03 16:59:43 +00:00
|
|
|
Return whether the column might be resized by the
|
|
|
|
user by dragging the column header border.
|
2002-07-17 14:06:33 +00:00
|
|
|
|
|
|
|
</p>
|
|
|
|
<hr width="25%" align="left" />
|
|
|
|
<h3><a name="method$NSTableColumn-maxWidth">maxWidth</a></h3>
|
|
|
|
- (float) <b>maxWidth</b>;<br />
|
|
|
|
<p>
|
|
|
|
|
2002-04-03 16:59:43 +00:00
|
|
|
Return the column's max width. The column can in no
|
|
|
|
way be resized to a width bigger than this max width.
|
|
|
|
The default max width is 100000.
|
2002-07-17 14:06:33 +00:00
|
|
|
|
|
|
|
</p>
|
|
|
|
<hr width="25%" align="left" />
|
|
|
|
<h3><a name="method$NSTableColumn-minWidth">minWidth</a></h3>
|
|
|
|
- (float) <b>minWidth</b>;<br />
|
|
|
|
<p>
|
|
|
|
|
2002-04-03 16:59:43 +00:00
|
|
|
Return the column's min width. The column can in no
|
|
|
|
way be resized to a width smaller than this min width.
|
|
|
|
The default min width is zero.
|
2002-07-17 14:06:33 +00:00
|
|
|
|
|
|
|
</p>
|
|
|
|
<hr width="25%" align="left" />
|
|
|
|
<h3><a name="method$NSTableColumn-setDataCell:">setDataCell:</a></h3>
|
|
|
|
- (void) <b>setDataCell:</b> (<a rel="gsdoc" href="NSCell.html#class$NSCell">NSCell</a>*)aCell;<br />
|
|
|
|
<p>
|
|
|
|
|
2002-04-03 16:59:43 +00:00
|
|
|
Set the cell used to display data in the column.
|
|
|
|
<var>aCell</var> can't be <code>nil</code>, otherwise
|
|
|
|
a warning will be generated and the method ignored. The
|
|
|
|
old cell is released, the new one is retained. If you
|
|
|
|
want to change the attributes in which a single row in
|
|
|
|
a column is displayed, you should better use a delegate
|
|
|
|
for your NSTableView implementing
|
|
|
|
tableView:willDisplayCell:forTableColumn:row:.
|
2002-07-17 14:06:33 +00:00
|
|
|
|
|
|
|
</p>
|
|
|
|
<hr width="25%" align="left" />
|
|
|
|
<h3><a name="method$NSTableColumn-setEditable:">setEditable:</a></h3>
|
|
|
|
- (void) <b>setEditable:</b> (BOOL)flag;<br />
|
|
|
|
<p>
|
|
|
|
|
2002-04-03 16:59:43 +00:00
|
|
|
Set whether data in the column might be edited by the
|
|
|
|
user by double-cliking on them.
|
2002-07-17 14:06:33 +00:00
|
|
|
|
|
|
|
</p>
|
|
|
|
<hr width="25%" align="left" />
|
|
|
|
<h3><a name="method$NSTableColumn-setHeaderCell:">setHeaderCell:</a></h3>
|
|
|
|
- (void) <b>setHeaderCell:</b> (<a rel="gsdoc" href="NSCell.html#class$NSCell">NSCell</a>*)aCell;<br />
|
|
|
|
<p>
|
|
|
|
|
2002-04-03 16:59:43 +00:00
|
|
|
Set the cell used to display the column header.
|
|
|
|
<var>aCell</var> can't be <code>nil</code>, otherwise
|
|
|
|
a warning will be generated and the method call ignored.
|
|
|
|
The old cell is released, the new one is retained.
|
2002-07-17 14:06:33 +00:00
|
|
|
|
|
|
|
</p>
|
|
|
|
<hr width="25%" align="left" />
|
|
|
|
<h3><a name="method$NSTableColumn-setIdentifier:">setIdentifier:</a></h3>
|
|
|
|
- (void) <b>setIdentifier:</b> (id)anObject;<br />
|
|
|
|
<p>
|
|
|
|
|
2002-04-03 16:59:43 +00:00
|
|
|
Set the identifier used to identify the table. The old
|
|
|
|
identifier is released, and the new one is
|
|
|
|
retained.
|
2002-07-17 14:06:33 +00:00
|
|
|
|
|
|
|
</p>
|
|
|
|
<hr width="25%" align="left" />
|
|
|
|
<h3><a name="method$NSTableColumn-setMaxWidth:">setMaxWidth:</a></h3>
|
|
|
|
- (void) <b>setMaxWidth:</b> (float)maxWidth;<br />
|
|
|
|
<p>
|
|
|
|
|
2002-04-03 16:59:43 +00:00
|
|
|
Set the max width of the table column, eventually
|
|
|
|
adjusting the width of the column if it is bigger
|
|
|
|
than the new max width. In no way a table column can
|
|
|
|
be made bigger than its max width.
|
2002-07-17 14:06:33 +00:00
|
|
|
|
|
|
|
</p>
|
|
|
|
<hr width="25%" align="left" />
|
|
|
|
<h3><a name="method$NSTableColumn-setMinWidth:">setMinWidth:</a></h3>
|
|
|
|
- (void) <b>setMinWidth:</b> (float)minWidth;<br />
|
|
|
|
<p>
|
|
|
|
|
2002-04-03 16:59:43 +00:00
|
|
|
Set the min width of the table column, eventually
|
|
|
|
adjusting the width of the column if it is
|
|
|
|
smaller than the new min width. In no way a table
|
|
|
|
column can be made smaller than its min width.
|
2002-07-17 14:06:33 +00:00
|
|
|
|
|
|
|
</p>
|
|
|
|
<hr width="25%" align="left" />
|
|
|
|
<h3><a name="method$NSTableColumn-setResizable:">setResizable:</a></h3>
|
|
|
|
- (void) <b>setResizable:</b> (BOOL)flag;<br />
|
|
|
|
<p>
|
|
|
|
|
2002-04-03 16:59:43 +00:00
|
|
|
Set whether the user can resize the table column by
|
|
|
|
dragging the border of its header with the mouse.
|
|
|
|
The table column can be resized programmatically
|
|
|
|
regardless of this setting.
|
2002-07-17 14:06:33 +00:00
|
|
|
|
|
|
|
</p>
|
|
|
|
<hr width="25%" align="left" />
|
|
|
|
<h3><a name="method$NSTableColumn-setTableView:">setTableView:</a></h3>
|
|
|
|
- (void) <b>setTableView:</b> (<a rel="gsdoc" href="NSTableView.html#class$NSTableView">NSTableView</a>*)aTableView;<br />
|
|
|
|
<p>
|
|
|
|
|
2002-04-03 16:59:43 +00:00
|
|
|
Set the table view corresponding to this table column.
|
|
|
|
This method is invoked internally by the table view,
|
|
|
|
and you should not call it directly; it is exposed
|
|
|
|
because you may want to override it in subclasses.
|
|
|
|
To use the table column in a table view, you should use
|
|
|
|
NSTableView's addTableColumn: instead.
|
2002-07-17 14:06:33 +00:00
|
|
|
|
|
|
|
</p>
|
|
|
|
<hr width="25%" align="left" />
|
|
|
|
<h3><a name="method$NSTableColumn-setWidth:">setWidth:</a></h3>
|
|
|
|
- (void) <b>setWidth:</b> (float)newWidth;<br />
|
|
|
|
<p>
|
|
|
|
|
2002-04-03 16:59:43 +00:00
|
|
|
Set the width of the table column. Before being
|
|
|
|
resized, the new width is constrained to the table
|
|
|
|
column minimum and maximum width: if
|
|
|
|
<var>newWidth</var> is smaller than the table
|
|
|
|
column's min width, the table column is simply
|
|
|
|
resized to its min width. If <var>newWidth</var> is
|
|
|
|
bigger than the table column's max width, the table
|
|
|
|
column is simply resized to its max width.
|
|
|
|
Otherwise, it is resized to <var>newWidth</var>.
|
|
|
|
If the width of the table was actually changed, the
|
|
|
|
table view (if any) is redisplayed (by calling tile),
|
|
|
|
and the NSTableViewColumnDidResizeNotification is
|
|
|
|
posted on behalf of the table view.
|
2002-07-17 14:06:33 +00:00
|
|
|
|
|
|
|
</p>
|
|
|
|
<hr width="25%" align="left" />
|
|
|
|
<h3><a name="method$NSTableColumn-sizeToFit">sizeToFit</a></h3>
|
|
|
|
- (void) <b>sizeToFit</b>;<br />
|
|
|
|
<p>
|
|
|
|
|
2002-04-03 16:59:43 +00:00
|
|
|
Change the width of the column to be just enough to
|
|
|
|
display its header; change the minimum width and
|
|
|
|
maximum width to allow the column to have this
|
|
|
|
width (if the minimum width is bigger than the column
|
|
|
|
header width, it is reduced to it; if the maximum
|
|
|
|
width is smaller than the column header width, it is
|
|
|
|
increased to it).
|
2002-07-17 14:06:33 +00:00
|
|
|
|
|
|
|
</p>
|
|
|
|
<hr width="25%" align="left" />
|
|
|
|
<h3><a name="method$NSTableColumn-tableView">tableView</a></h3>
|
|
|
|
- (<a rel="gsdoc" href="NSTableView.html#class$NSTableView">NSTableView</a>*) <b>tableView</b>;<br />
|
|
|
|
<p>
|
|
|
|
|
2002-04-03 16:59:43 +00:00
|
|
|
Return the table view the column belongs to, or
|
|
|
|
<code>nil</code> if the table column was not added
|
|
|
|
to any table view.
|
2002-07-17 14:06:33 +00:00
|
|
|
|
|
|
|
</p>
|
|
|
|
<hr width="25%" align="left" />
|
|
|
|
<h3><a name="method$NSTableColumn-width">width</a></h3>
|
|
|
|
- (float) <b>width</b>;<br />
|
|
|
|
<p>
|
|
|
|
|
2002-04-03 16:59:43 +00:00
|
|
|
Return the width of the table column.
|
2002-07-17 14:06:33 +00:00
|
|
|
|
|
|
|
</p>
|
|
|
|
<hr width="25%" align="left" />
|
|
|
|
<br />
|
|
|
|
<a href="Gui.html">Up</a>
|
|
|
|
</body>
|
|
|
|
</html>
|