gtk.TreeStore.TreeStore Class Reference

Inheritance diagram for gtk.TreeStore.TreeStore:

gtk.TreeModel.TreeModel List of all members.

Public Member Functions

GtkTreeStoregetTreeStoreStruct ()
 this (GtkTreeStore *gtkTreeStore)
 Sets our main struct and passes it to the parent class.
 this (GType[] types)
 Non-vararg creation function.
TreeIter createIter (TreeIter parent=null)
 Creates a top level iteractor.
void setValue (TreeIter iter, int column, char[] value)
 Sets one value into one cells.
void setValue (TreeIter iter, int column, int value)
void setValue (TreeIter iter, int column, Pixbuf pixbuf)
void set (TreeIter iter, int[] columns, char *[] values)
 sets the values for one row
void set (TreeIter iter, int[] columns, char[][] values)
void set (TreeIter iter, TreeNode treeNode)
 Sets an iteractor values from a tree node.
TreeIter prepend (TreeIter parent)
 Creates and prepends a new row to tree_store.
TreeIter append (TreeIter parent)
 Creates and appends a new row to tree_store.
 this (int nColumns,...)
 Creates a new tree store as with n_columns columns each of the types passed in.
 this (int nColumns, GType *types)
 Non vararg creation function.
void setColumnTypes (int nColumns, GType *types)
 This function is meant primarily for GObjects that inherit from GtkTreeStore, and should only be used when constructing a new GtkTreeStore.
void setValue (TreeIter iter, int column, Value value)
 Sets the data in the cell specified by iter and column.
void setValist (TreeIter iter, void *varArgs)
 See gtk_tree_store_set(); this version takes a va_list for use by language bindings.
int remove (TreeIter iter)
 Removes iter from tree_store.
void insert (TreeIter iter, TreeIter parent, int position)
 Creates a new row at position.
void insertBefore (TreeIter iter, TreeIter parent, TreeIter sibling)
 Inserts a new row before sibling.
void insertAfter (TreeIter iter, TreeIter parent, TreeIter sibling)
 Inserts a new row after sibling.
void insertWithValues (TreeIter iter, TreeIter parent, int position,...)
 Creates a new row at position.
void insertWithValuesv (TreeIter iter, TreeIter parent, int position, int *columns, Value values, int nValues)
 A variant of gtk_tree_store_insert_with_values() which takes the columns and values as two arrays, instead of varargs.
void prepend (TreeIter iter, TreeIter parent)
 Prepends a new row to tree_store.
void append (TreeIter iter, TreeIter parent)
 Appends a new row to tree_store.
int isAncestor (TreeIter iter, TreeIter descendant)
 Returns TRUE if iter is an ancestor of descendant.
int iterDepth (TreeIter iter)
 Returns the depth of iter.
void clear ()
 Removes all rows from tree_store tree_store: a GtkTreeStore.
int iterIsValid (TreeIter iter)
 WARNING: This function is slow.
void reorder (TreeIter parent, int *newOrder)
 Reorders the children of parent in tree_store to follow the order indicated by new_order.
void swap (TreeIter a, TreeIter b)
 Swaps a and b in the same level of tree_store.
void moveBefore (TreeIter iter, TreeIter position)
 Moves iter in tree_store to the position before position.
void moveAfter (TreeIter iter, TreeIter position)
 Moves iter in tree_store to the position after position.

Protected Member Functions

void * getStruct ()
 the main Gtk struct as a void*

Protected Attributes

GtkTreeStoregtkTreeStore
 the main Gtk struct

Constructor & Destructor Documentation

gtk.TreeStore.TreeStore.this ( GtkTreeStore gtkTreeStore  ) 

Sets our main struct and passes it to the parent class.

gtk.TreeStore.TreeStore.this ( GType[]  types  ) 

Non-vararg creation function.

Used primarily by language bindings. n_columns: number of columns in the list store types: an array of GType types for the columns, from first to last Returns: a new GtkListStore

gtk.TreeStore.TreeStore.this ( int  nColumns,
  ... 
)

Creates a new tree store as with n_columns columns each of the types passed in.

Note that only types derived from standard GObject fundamental types are supported. As an example, gtk_tree_store_new (3, G_TYPE_INT, G_TYPE_STRING, GDK_TYPE_PIXBUF); will create a new GtkTreeStore with three columns, of type int, string and GdkPixbuf respectively. n_columns: number of columns in the tree store ...: all GType types for the columns, from first to last Returns: a new GtkTreeStore

gtk.TreeStore.TreeStore.this ( int  nColumns,
GType types 
)

Non vararg creation function.

Used primarily by language bindings. n_columns: number of columns in the tree store types: an array of GType types for the columns, from first to last Returns: a new GtkTreeStore


Member Function Documentation

void gtk.TreeStore.TreeStore.append ( TreeIter  iter,
TreeIter  parent 
)

Appends a new row to tree_store.

If parent is non-NULL, then it will append the new row after the last child of parent, otherwise it will append a row to the top level. iter will be changed to point to this new row. The row will be empty after this function is called. To fill in values, you need to call gtk_tree_store_set() or gtk_tree_store_set_value(). tree_store: A GtkTreeStore iter: An unset GtkTreeIter to set to the appended row parent: A valid GtkTreeIter, or NULL

TreeIter gtk.TreeStore.TreeStore.append ( TreeIter  parent  ) 

Creates and appends a new row to tree_store.

If parent is non-NULL, then it will append the new row after the last child of parent, otherwise it will append a row to the top level. iter will be changed to point to this new row. The row will be empty after this function is called. To fill in values, you need to call gtk_tree_store_set() or gtk_tree_store_set_value(). parent: A valid GtkTreeIter, or NULL

void gtk.TreeStore.TreeStore.clear (  ) 

Removes all rows from tree_store tree_store: a GtkTreeStore.

TreeIter gtk.TreeStore.TreeStore.createIter ( TreeIter  parent = null  ) 

Creates a top level iteractor.

I don't think lists have but the top level iteractor

void* gtk.TreeStore.TreeStore.getStruct (  )  [protected]

the main Gtk struct as a void*

Reimplemented from gtk.TreeModel.TreeModel.

GtkTreeStore* gtk.TreeStore.TreeStore.getTreeStoreStruct (  ) 

void gtk.TreeStore.TreeStore.insert ( TreeIter  iter,
TreeIter  parent,
int  position 
)

Creates a new row at position.

If parent is non-NULL, then the row will be made a child of parent. Otherwise, the row will be created at the toplevel. If position is larger than the number of rows at that level, then the new row will be inserted to the end of the list. iter will be changed to point to this new row. The row will be empty after this function is called. To fill in values, you need to call gtk_tree_store_set() or gtk_tree_store_set_value(). tree_store: A GtkTreeStore iter: An unset GtkTreeIter to set to the new row parent: A valid GtkTreeIter, or NULL position: position to insert the new row

void gtk.TreeStore.TreeStore.insertAfter ( TreeIter  iter,
TreeIter  parent,
TreeIter  sibling 
)

Inserts a new row after sibling.

If sibling is NULL, then the row will be prepended to parent 's children. If parent and sibling are NULL, then the row will be prepended to the toplevel. If both sibling and parent are set, then parent must be the parent of sibling. When sibling is set, parent is optional. iter will be changed to point to this new row. The row will be empty after this function is called. To fill in values, you need to call gtk_tree_store_set() or gtk_tree_store_set_value(). tree_store: A GtkTreeStore iter: An unset GtkTreeIter to set to the new row parent: A valid GtkTreeIter, or NULL sibling: A valid GtkTreeIter, or NULL

void gtk.TreeStore.TreeStore.insertBefore ( TreeIter  iter,
TreeIter  parent,
TreeIter  sibling 
)

Inserts a new row before sibling.

If sibling is NULL, then the row will be appended to parent 's children. If parent and sibling are NULL, then the row will be appended to the toplevel. If both sibling and parent are set, then parent must be the parent of sibling. When sibling is set, parent is optional. iter will be changed to point to this new row. The row will be empty after this function is called. To fill in values, you need to call gtk_tree_store_set() or gtk_tree_store_set_value(). tree_store: A GtkTreeStore iter: An unset GtkTreeIter to set to the new row parent: A valid GtkTreeIter, or NULL sibling: A valid GtkTreeIter, or NULL

void gtk.TreeStore.TreeStore.insertWithValues ( TreeIter  iter,
TreeIter  parent,
int  position,
  ... 
)

Creates a new row at position.

iter will be changed to point to this new row. If position is larger than the number of rows on the list, then the new row will be appended to the list. The row will be filled with the values given to this function. Calling gtk_tree_store_insert_with_values (tree_store, iter, position, ...) has the same effect as calling gtk_tree_store_insert (tree_store, iter, position); gtk_tree_store_set (tree_store, iter, ...); with the different that the former will only emit a row_inserted signal, while the latter will emit row_inserted, row_changed and if the tree store is sorted, rows_reordered. Since emitting the rows_reordered signal repeatedly can affect the performance of the program, gtk_tree_store_insert_with_values() should generally be preferred when inserting rows in a sorted tree store. tree_store: A GtkTreeStore iter: An unset GtkTreeIter to set the new row, or NULL. parent: A valid GtkTreeIter, or NULL position: position to insert the new row ...: pairs of column number and value, terminated with -1 Since 2.10

void gtk.TreeStore.TreeStore.insertWithValuesv ( TreeIter  iter,
TreeIter  parent,
int  position,
int columns,
Value  values,
int  nValues 
)

A variant of gtk_tree_store_insert_with_values() which takes the columns and values as two arrays, instead of varargs.

This function is mainly intended for language bindings. tree_store: A GtkTreeStore iter: An unset GtkTreeIter to set the new row, or NULL. parent: A valid GtkTreeIter, or NULL position: position to insert the new row columns: an array of column numbers values: an array of GValues n_values: the length of the columns and values arrays Since 2.10

int gtk.TreeStore.TreeStore.isAncestor ( TreeIter  iter,
TreeIter  descendant 
)

Returns TRUE if iter is an ancestor of descendant.

That is, iter is the parent (or grandparent or great-grandparent) of descendant. tree_store: A GtkTreeStore iter: A valid GtkTreeIter descendant: A valid GtkTreeIter Returns: TRUE, if iter is an ancestor of descendant

int gtk.TreeStore.TreeStore.iterDepth ( TreeIter  iter  ) 

Returns the depth of iter.

This will be 0 for anything on the root level, 1 for anything down a level, etc. tree_store: A GtkTreeStore iter: A valid GtkTreeIter Returns: The depth of iter

int gtk.TreeStore.TreeStore.iterIsValid ( TreeIter  iter  ) 

WARNING: This function is slow.

Only use it for debugging and/or testing purposes. Checks if the given iter is a valid iter for this GtkTreeStore. tree_store: A GtkTreeStore. iter: A GtkTreeIter. Returns: TRUE if the iter is valid, FALSE if the iter is invalid. Since 2.2

void gtk.TreeStore.TreeStore.moveAfter ( TreeIter  iter,
TreeIter  position 
)

Moves iter in tree_store to the position after position.

iter and position should be in the same level. Note that this function only works with unsorted stores. If position is NULL, iter will be moved to the start of the level. tree_store: A GtkTreeStore. iter: A GtkTreeIter. position: A GtkTreeIter. Since 2.2 See Also GtkTreeModel, GtkTreeStore

void gtk.TreeStore.TreeStore.moveBefore ( TreeIter  iter,
TreeIter  position 
)

Moves iter in tree_store to the position before position.

iter and position should be in the same level. Note that this function only works with unsorted stores. If position is NULL, iter will be moved to the end of the level. tree_store: A GtkTreeStore. iter: A GtkTreeIter. position: A GtkTreeIter or NULL. Since 2.2

void gtk.TreeStore.TreeStore.prepend ( TreeIter  iter,
TreeIter  parent 
)

Prepends a new row to tree_store.

If parent is non-NULL, then it will prepend the new row before the first child of parent, otherwise it will prepend a row to the top level. iter will be changed to point to this new row. The row will be empty after this function is called. To fill in values, you need to call gtk_tree_store_set() or gtk_tree_store_set_value(). tree_store: A GtkTreeStore iter: An unset GtkTreeIter to set to the prepended row parent: A valid GtkTreeIter, or NULL

TreeIter gtk.TreeStore.TreeStore.prepend ( TreeIter  parent  ) 

Creates and prepends a new row to tree_store.

If parent is non-NULL, then it will prepend the new row before the first child of parent, otherwise it will prepend a row to the top level. iter will be changed to point to this new row. The row will be empty after this function is called. To fill in values, you need to call gtk_tree_store_set() or gtk_tree_store_set_value(). parent: A valid GtkTreeIter, or NULL

int gtk.TreeStore.TreeStore.remove ( TreeIter  iter  ) 

Removes iter from tree_store.

After being removed, iter is set to the next valid row at that level, or invalidated if it previously pointed to the last one. tree_store: A GtkTreeStore iter: A valid GtkTreeIter Returns: TRUE if iter is still valid, FALSE if not.

void gtk.TreeStore.TreeStore.reorder ( TreeIter  parent,
int newOrder 
)

Reorders the children of parent in tree_store to follow the order indicated by new_order.

Note that this function only works with unsorted stores. tree_store: A GtkTreeStore. parent: A GtkTreeIter. new_order: an array of integers mapping the new position of each child to its old position before the re-ordering, i.e. new_order[newpos] = oldpos. Since 2.2

void gtk.TreeStore.TreeStore.set ( TreeIter  iter,
TreeNode  treeNode 
)

Sets an iteractor values from a tree node.

This is the way to add a new row to the tree, the iteractor is either a top level iteractor created from createIter() or a nested iteractor created from append()

Parameters:
iter the iteractor to set
treeNode the tree node
See also:
createIter()

append()

void gtk.TreeStore.TreeStore.set ( TreeIter  iter,
int[]  columns,
char  values[][] 
)

void gtk.TreeStore.TreeStore.set ( TreeIter  iter,
int[]  columns,
char *[]  values 
)

sets the values for one row

Parameters:
iter the row iteractor
columns an arrays with the columns to set
values an arrays with the values

void gtk.TreeStore.TreeStore.setColumnTypes ( int  nColumns,
GType types 
)

This function is meant primarily for GObjects that inherit from GtkTreeStore, and should only be used when constructing a new GtkTreeStore.

It will not function after a row has been added, or a method on the GtkTreeModel interface is called. tree_store: A GtkTreeStore n_columns: Number of columns for the tree store types: An array of GType types, one for each column

void gtk.TreeStore.TreeStore.setValist ( TreeIter  iter,
void *  varArgs 
)

See gtk_tree_store_set(); this version takes a va_list for use by language bindings.

tree_store: A GtkTreeStore iter: A valid GtkTreeIter for the row being modified var_args: va_list of column/value pairs

void gtk.TreeStore.TreeStore.setValue ( TreeIter  iter,
int  column,
Value  value 
)

Sets the data in the cell specified by iter and column.

The type of value must be convertible to the type of the column. tree_store: a GtkTreeStore iter: A valid GtkTreeIter for the row being modified column: column number to modify value: new value for the cell

void gtk.TreeStore.TreeStore.setValue ( TreeIter  iter,
int  column,
Pixbuf  pixbuf 
)

Todo:
confirm we need to destroy the Value instance

void gtk.TreeStore.TreeStore.setValue ( TreeIter  iter,
int  column,
int  value 
)

void gtk.TreeStore.TreeStore.setValue ( TreeIter  iter,
int  column,
char[]  value 
)

Sets one value into one cells.

Parameters:
iter the tree iteractor, effectivly the row
column to column number to set
value the value
Todo:
confirm we need to destroy the Value instance

void gtk.TreeStore.TreeStore.swap ( TreeIter  a,
TreeIter  b 
)

Swaps a and b in the same level of tree_store.

Note that this function only works with unsorted stores. tree_store: A GtkTreeStore. a: A GtkTreeIter. b: Another GtkTreeIter. Since 2.2


Member Data Documentation

GtkTreeStore* gtk.TreeStore.TreeStore.gtkTreeStore [protected]

the main Gtk struct


SourceForge.net Logo DSource.org Logo digitalmars.com Logo