Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

VDKTreeViewModelIterator Class Reference

#include <vdktreeview.h>

List of all members.

Public Methods


Detailed Description

Provides an iterator on VDKTreeViewModel


Constructor & Destructor Documentation

VDKTreeViewModelIterator::VDKTreeViewModelIterator VDKTreeViewModel   model,
GtkTreeIter *    parent = NULL
 

Constructor

Parameters:
model 
parent  if NULL makes an iterator on top level nodes, otherwise makes an iterator on parent childs


Member Function Documentation

GtkTreeIter* VDKTreeViewModelIterator::current   [inline]
 

return node presently visited

bool VDKTreeViewModelIterator::HasChild  
 

Returns true if presently visited node has a child. TIP: Since iterator incremental operator skips on next sibling node, you can use this to visit all tree nodes on depth-first strategy using recursion. See example below taken from /testvdk/treeviewcompo.cc:

    void 
    TreeViewComponent::recurse(GtkTreeIter* iter)
    {
    VDKTreeViewModel* model = tree->Model;
    VDKTreeViewModelIterator ti(model,iter);
    for(;ti;ti++)
      {
      PrintRow(ti.current()); // uses presently pointed node 
      if(ti.HasChild())
        recurse (ti.current());
      }
    }
    bool
    TreeViewComponent::OnTrasverseClicked (VDKObject* sender)
    {
     recurse(NULL);
     return true;
    }

VDKTreeViewModelIterator::operator int   [inline]
 

Returns true if presently visited node is valid

void VDKTreeViewModelIterator::operator++ int   
 

Incremental operator (infix), visit next sibling node

void VDKTreeViewModelIterator::operator++  
 

Incremental operator (postfix), visit next sibling node


The documentation for this class was generated from the following files:
Generated on Sat May 4 22:00:29 2002 for vdk 2.0.1 by doxygen1.2.15