Project:DUI

Class List Class Hierarchy
Summary: Ctors Methods Mixins

Module dui.ListStore

Class ListStore

dui.ObjectG.ObjectG
        dui.TreeModel.TreeModel
                dui.ListStore.ListStore

Implemented interfaces:


public class

ListStore



The model to display a TreeView as a list The GtkListStore object is a list model for use with a GtkTreeView widget.
It implements the GtkTreeModel interface, and consequentialy, can use all of the methods available there. It also implements the GtkTreeSortable interface so it can be sorted by the view. Finally, it also implements the tree drag and drop interfaces. The GtkListStore can accept most GObject types as a column type, though it can't accept all custom types. Internally, it will keep a copy of data passed in (such as a string or a boxed pointer). Columns that accept GObjects are handled a little differently. The GtkListStore will keep a reference to the object instead of copying the value. As a result, if the object is modified, it is up to the application writer to call gtk_tree_model_row_changed to emit the "row_changed" signal. This most commonly effects lists with GdkPixbufs stored.

Constructor Summary
(GObject* gObject)
          
public (GType types)
          Creates a new ListStore with the given types for the columns

Methods Summary
public GType getType()
          Gets this class type
GtkTreeModel* model()
          Gets the GtkTreeModel
TreeIter createIter()
          Creates a top level iteractor.
void set(TreeIter iter, int columns, void* values)
          sets the values for one row
void set(TreeIter iter, int columns, String values)
          Sets an iteractor values.
void set(TreeIter iter, TreeNode treeNode)
          Sets an iteractor values from a tree node.
void setValue(TreeIter iter, int column, char value)
          Sets the values for a row
void setValue(TreeIter iter, int column, String value)
          
bit remove(TreeIter iter)
          
void insert(TreeIter iter, gint position)
          Creates a new row at position.
void insertBefore(TreeIter iter, TreeIter sibling)
          Inserts a new row before sibling.
void insertAfter(TreeIter iter, TreeIter sibling)
          Inserts a new row after sibling.
void prepend(TreeIter iter)
          Prepends a new row to list_store.
void append(TreeIter iter)
          Appends a new row to list_store.
void clear()
          Removes all rows from the list store.
bit iterIsValid(TreeIter iter)
          Checks if the given iter is a valid iter for this GtkListStore.
void reorder(gint newOrder)
          Reorders store to follow the order indicated by new_order.
void swap(TreeIter a, TreeIter b)
          Swaps a and b in store.
void moveAfter(TreeIter iter, TreeIter position)
          Moves iter in store to the position after position.
void modeBefore(TreeIter iter, TreeIter position)
          Moves iter in store to the position before position.


getType

public GType getType()
Gets this class type

Returns:
type



ctor(ListStore)(GObject* gObject)



public ctor(ListStore)(GType types)
Creates a new ListStore with the given types for the columns

Parameters:
types - the array of column types

model

GtkTreeModel* model()
Gets the GtkTreeModel

createIter

TreeIter createIter()
Creates a top level iteractor.
I don't think lists have but the top level iteractor

set

void set(TreeIter iter, int columns, void* 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

set

void set(TreeIter iter, int columns, String values)
Sets an iteractor values.
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()
@see createIter()
@see append()

Parameters:
iter - the iteractor to set
columns - the numbers of the columns to set
values - the values to set into the cells

set

void 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()
@see createIter()
@see append()

Parameters:
iter - the iteractor to set
treeNode - the tree node

setValue

void setValue(TreeIter iter, int column, char value)
Sets the values for a row

Parameters:
iter -
column - the column to affect
value - an array of GValues

setValue

void setValue(TreeIter iter, int column, String value)

remove

bit remove(TreeIter iter)

insert

void insert(TreeIter iter, gint 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 empty before this function is called. To fill in values, you need to call gtk_list_store_set() or gtk_list_store_set_value().

Parameters:
iter -
position -

insertBefore

void insertBefore(TreeIter iter, TreeIter sibling)
Inserts a new row before sibling.
If sibling is NULL, then the row will be appended to the end of the list. iter will be changed to point to this new row. The row will be empty before this function is called. To fill in values, you need to call gtk_list_store_set() or gtk_list_store_set_value().

Parameters:
iter -
sibling -

insertAfter

void insertAfter(TreeIter iter, TreeIter sibling)
Inserts a new row after sibling.
If sibling is NULL, then the row will be prepended to the beginning 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_list_store_set() or gtk_list_store_set_value().

Parameters:
iter -
sibling -

prepend

void prepend(TreeIter iter)
Prepends a new row to list_store.
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_list_store_set() or gtk_list_store_set_value().

Parameters:
iter -

append

void append(TreeIter iter)
Appends a new row to list_store.
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_list_store_set() or gtk_list_store_set_value().

Parameters:
iter -

clear

void clear()
Removes all rows from the list store.

iterIsValid

bit iterIsValid(TreeIter iter)
Checks if the given iter is a valid iter for this GtkListStore.
WARNING: This function is slow. Only use it for debugging and/or testing purposes.

Parameters:
iter -

reorder

void reorder(gint newOrder)
Reorders store to follow the order indicated by new_order.
Note that this function only works with unsorted stores.

Parameters:
newOrder -

swap

void swap(TreeIter a, TreeIter b)
Swaps a and b in store.
Note that this function only works with unsorted stores.

Parameters:
a -
b -

moveAfter

void moveAfter(TreeIter iter, TreeIter position)
Moves iter in store to the position after position.
Note that this function only works with unsorted stores. If position is NULL, iter will be moved to the start of the list.

Parameters:
iter -
position -

modeBefore

void modeBefore(TreeIter iter, TreeIter position)
Moves iter in store to the position before position.
Note that this function only works with unsorted stores. If position is NULL, iter will be moved to the end of the list.

Parameters:
iter -
position -