GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

GFC::Gtk::TreePath Class Reference

A GtkTreePath C++ wrapper class. More...

#include <gfc/gtk/treemodel.hh>

Inheritance diagram for GFC::Gtk::TreePath:

GFC::G::Boxed GFC::Object GFC::Trackable List of all members.

Public Member Functions

Constructors
Accessors
Methods

Detailed Description

A GtkTreePath C++ wrapper class.

A tree path is essentially a potential node. It is a location on a tree model that may or may not actually correspond to a node on a specific model. The TreePath can be converted into either a vector of integers or a string. The string form is a list of numbers separated by a colon. Each number refers to the offset at that level. Thus, the path "0" refers to the root node and the path "2:4" refers to the fifth child of the third node.


Constructor & Destructor Documentation

GFC::Gtk::TreePath::TreePath const String path  )  [explicit]
 

Constructs a new tree path initialized to path, or the root if path is null.

Parameters:
path The string representation of a path.

The path is expected to be a colon separated list of numbers. For example, the string "10:4:0" would create a path of depth 3 pointing to the 11th child of the root node, the 5th child of that 11th child, and the 1st child of that 5th child.

GFC::Gtk::TreePath::TreePath int  first_index,
  ...
[explicit]
 

Construct a new path with first_index and varargs as the indices.

Parameters:
first_index The first integer.
... A list of integers, terminated by -1.

GFC::Gtk::TreePath::TreePath GtkTreePath *  path  )  [explicit]
 

Construct a new tree path from an existing GtkTreePath.

Parameters:
path A pointer to a GtkTreePath.

The path can be a newly created GtkTreePath or an existing GtkTreePath. The TreePath object created is a temporary object. It doesn't take over the ownership of GtkTreePath and GtkTreePath is not freed by the destructor.

GFC::Gtk::TreePath::TreePath GtkTreePath *  path,
bool  copy
 

Construct a new text iterator from an existing GtkTreePath.

Parameters:
path A pointer to a GtkTreePath.
copy Whether the TreePath object should make a copy of GtkTreePath or not.

The path can be a newly created GtkTreePath or an existing GtkTreePath. If copy is true TreePath will make a copy of GtkTreePath. If copy is false TreePath wont make a copy but instead takes over the ownership of GtkTreePath. Either way, the destructor will free GtkTreePath when the TreePath object is destroyed. This constructor is used by G::Boxed::wrap() to wrap GtkTreePath objects in a C++ wrapper.

GFC::Gtk::TreePath::TreePath const TreePath src  ) 
 

Copy constructor.

Parameters:
src The source tree path.


Member Function Documentation

void GFC::Gtk::TreePath::append_index int  index  ) 
 

Appends a new index to the path; as a result, the depth of the path is increased.

Parameters:
index The index.

int GFC::Gtk::TreePath::compare const TreePath other  )  const
 

Compares two paths.

Parameters:
other A TreePath to compare with.
Returns:
The relative positions of two paths.

If this path appears before other in a tree, then -1 is returned. If other appears before this path, then 1 is returned. If the two nodes are equal, then 0 is returned.

bool GFC::Gtk::TreePath::is_ancestor const TreePath descendant  )  const
 

Returns true if descendant is a descendant of this path.

Parameters:
descendant Another TreePath.
Returns:
true if descendant is contained inside this path.

bool GFC::Gtk::TreePath::is_descendant const TreePath ancestor  )  const
 

Returns true if path is a descendant of ancestor.

Parameters:
ancestor Another TreePath.
Returns:
true if ancestor contains path somewhere below it.

TreePath& GFC::Gtk::TreePath::operator= const TreePath src  ) 
 

Assignment operator.

Parameters:
src The source tree path.

void GFC::Gtk::TreePath::prepend_index int  index  ) 
 

Prepends a new index to the path; as a result, the depth of the path is increased.

Parameters:
index The index.

bool GFC::Gtk::TreePath::prev  ) 
 

Moves the path to point to the previous node at the current depth, if it exists.

Returns:
true if the path has a previous node, and the move was made.

String GFC::Gtk::TreePath::to_string  )  const
 

Generates a string representation of the path.

This string is a ':' separated list of numbers. For example, "4:10:0:3" would be an acceptable return value for this string.

bool GFC::Gtk::TreePath::up  ) 
 

Moves the path to point to it's parent node, if it has a parent.

Returns:
true if the path has a parent, and the move was made.


The documentation for this class was generated from the following file:
Generated on Tue Aug 24 00:34:43 2004 for GFC-UI by doxygen 1.3.8