![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/share/GNUstep/Documentation/Developer/Gui/ProgrammingManual/AppKit/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <!-- (C) 2005-2006 Christopher Armstrong. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2, as published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". This documentation is provided on an "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND USEFULNESS OF THE DOCUMENTATION IS WITH YOU (THE LICENSEE). IN NO EVENT WILL THE COPYRIGHT HOLDERS BE LIABLE FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, GENERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENTATION (INCLUDING BUT NOT LIMITED TO LOSS OF DATA, USE, OR PROFITS; PROCUREMENT OF SUBSTITUTE GOODS AND SERVICES; OR BUSINESS INTERUPTION) HOWEVER CAUSED, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --> <!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ --> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>outlineviews (Using the GNUstep AppKit 0.1)</title> <meta name="description" content="outlineviews (Using the GNUstep AppKit 0.1)"> <meta name="keywords" content="outlineviews (Using the GNUstep AppKit 0.1)"> <meta name="resource-type" content="document"> <meta name="distribution" content="global"> <meta name="Generator" content="makeinfo"> <link href="index.html" rel="start" title="Top"> <link href="conceptindex.html" rel="index" title="conceptindex"> <link href="index.html" rel="up" title="Top"> <link href="matrix.html" rel="next" title="matrix"> <link href="tableview.html" rel="prev" title="tableview"> <style type="text/css"> <!-- a.summary-letter {text-decoration: none} blockquote.indentedblock {margin-right: 0em} div.display {margin-left: 3.2em} div.example {margin-left: 3.2em} div.lisp {margin-left: 3.2em} kbd {font-style: oblique} pre.display {font-family: inherit} pre.format {font-family: inherit} pre.menu-comment {font-family: serif} pre.menu-preformatted {font-family: serif} span.nolinebreak {white-space: nowrap} span.roman {font-family: initial; font-weight: normal} span.sansserif {font-family: sans-serif; font-weight: normal} ul.no-bullet {list-style: none} --> </style> </head> <body lang="en"> <span id="outlineviews"></span><div class="header"> <p> Next: <a href="matrix.html" accesskey="n" rel="next">matrix</a>, Previous: <a href="tableview.html" accesskey="p" rel="prev">tableview</a>, Up: <a href="index.html" accesskey="u" rel="up">Top</a> [<a href="conceptindex.html" title="Index" rel="index">Index</a>]</p> </div> <hr> <span id="Outline-Views"></span><h2 class="chapter">10 Outline Views</h2> <p>An <em>outline view</em> is a specialised form of table view designed for displaying hierachical data in a tree like format. It looks alot like a Windows’ TreeView Control, but operates differently, provides much more powerful functionality and it is less tedious to programme. </p> <p>The node’s in the outline view can be collapsed and expanded and display a list of sub-nodes. This makes the outline view hierachical. </p> <p>It uses the <code>NSOutlineView</code> class, which inherits from <code>NSTableView</code>. This means that most of the behaviour that applies to tableviews also applies to outline views, such as changing columns/rows and their display, etc. It extends the tableview with a hierachial layout for data, in which nodes can be expanded and contracted. </p> <p>Like the table view, the outline view control uses a data source object to get it’s data, as well as a delegate to modify it’s behaviour. These are objects implementing the informal protocols <code>NSOutlineViewDataSource</code> and <code>NSOutlineViewDelegate</code>. Although a delegate object is optional, outline views require a data source object. </p> <p>See the <cite>GNUstep GUI Reference</cite> for more information about outline views (including class documentation). </p> <span id="Using-a-Data-Source"></span><h3 class="section">10.1 Using a Data Source</h3> <p>The data source for an outline view implements the <code>NSOutlineViewDataSource</code> informal protocol. Some of it’s methods are compulsory; some are not. </p> <p>Note that a parameter in many of the delegate’s methods is an untyped object <var>item</var>. This object is supplied by you, and the outline view passes it back to your delegate as a representation of a node or leaf row. </p> <p>The outline view requires you implement the following methods: </p><dl compact="compact"> <dt><code>-(id) outlineView:(NSOutlineView*)outlineView child:(int)index ofItem:(id)item</code></dt> <dd><p>Returns the item that is the child of <var>item</var> at <var>index</var>. A <code>nil</code> item means that you should return the children of the root item. </p> </dd> <dt><code>-(BOOL) outlineView:(NSOutlineView*)outlineView isItemExpandable:(id)item</code></dt> <dd><p>Returns whether <var>item</var> is expandable. </p> </dd> <dt><code>-(int) outlineView:(NSOutlineView*)outlineView numberOfChildrenOfItem:(id)item</code></dt> <dd><p>Returns the number of child items of <var>item</var>. </p> </dd> <dt><code>-(id) outlineView:(NSOutlineView*)outlineView objectValueForTableColumn: (NSTableColumn*)tableColumn byItem:(id)item</code></dt> <dd><p>Returns the data object for <var>item</var> in <var>tableColumn</var> of the table view. </p></dd> </dl> <p>Full defintions of these (and optional methods) can be found in the <cite>GNUstep GUI Manual</cite>. </p> <hr> <div class="header"> <p> Next: <a href="matrix.html" accesskey="n" rel="next">matrix</a>, Previous: <a href="tableview.html" accesskey="p" rel="prev">tableview</a>, Up: <a href="index.html" accesskey="u" rel="up">Top</a> [<a href="conceptindex.html" title="Index" rel="index">Index</a>]</p> </div> </body> </html>