Etk
Main Page Object Hierarchy Data Structures Related Pages
Etk

Etk_Tree


Detailed Description

A tree is widget that displays rows of elements of different types (text, image, checkbox, etc), separated into columns.

tree.png

Object Hierarchy:
  • Etk_Object
    • Etk_Widget
      • Etk_Tree

Signals of Etk_Tree:
  • "row-selected": Emitted when a row is selected
    • Callback: void callback(Etk_Tree *tree, Etk_Tree_Row *row, void *data)
      • tree: the tree containing the row that has been selected
      • row: the row that has been selected
      • data: the user data set when the callback has been connected to the signal
  • "row-unselected": Emitted when a row is unselected
    • Callback: void callback(Etk_Tree *tree, Etk_Tree_Row *row, void *data)
      • tree: the tree containing the row that has been unselected
      • row: the row that has been unselected
      • data: the user data set when the callback has been connected to the signal
  • "all-selected": Emitted when all the rows of a tree are selected with etk_tree_select_all()
    • Callback: void callback(Etk_Tree *tree, void *data)
      • tree: the tree whose all rows have been selected
      • data: the user data set when the callback has been connected to the signal
  • "all-unselected": Emitted when all the rows of a tree are unselected with etk_tree_unselect_all()
    • Callback: void callback(Etk_Tree *tree, void *data)
      • tree: the tree whose all rows have been unselected
      • data: the user data set when the callback has been connected to the signal
  • "row-clicked": Emitted when a row of the tree has been clicked
    • Callback: void callback(Etk_Tree *tree, Etk_Tree_Row *row, Etk_Event_Mouse_Up *event, void *data)
      • tree: the tree containing the row that has been clicked
      • row: the row that has been clicked
      • event: the event-structure corresponding to the click event
      • data: the user data set when the callback has been connected to the signal
  • "row-activated": Emitted when a row is double-clicked or when the user presses "space" on a selected row
    • Callback: void callback(Etk_Tree *tree, Etk_Tree_Row *row, void *data)
      • tree: the tree containing the row that has been activated
      • row: the row that has been activated
      • data: the user data set when the callback has been connected to the signal
  • "row-unfolded": Emitted when a row is unfolded
    • Callback: void callback(Etk_Tree *tree, Etk_Tree_Row *row, void *data)
      • tree: the tree containing the row that has been unfolded
      • row: the row that has been unfolded
      • data: the user data set when the callback has been connected to the signal
  • "row-folded": Emitted when a row is folded
    • Callback: void callback(Etk_Tree *tree, Etk_Tree_Row *row, void *data)
      • tree: the tree containing the row that has been folded
      • row: the row that has been folded
      • data: the user data set when the callback has been connected to the signal
  • "row-shown": Emitted when a row becomes visible, i.e when the row enters in the tree's viewport
    • Callback: void callback(Etk_Tree *tree, Etk_Tree_Row *row, void *data)
      • tree: the tree containing the row that has hecome visible
      • row: the row that has hecome visible
      • data: the user data set when the callback has been connected to the signal
  • "row-hidden": Emitted when a row becomes invisible, i.e when the row leaves in the tree's viewport
    • Callback: void callback(Etk_Tree *tree, Etk_Tree_Row *row, void *data)
      • tree: the tree containing the row that has hecome invisible
      • row: the row that has hecome invisible
      • data: the user data set when the callback has been connected to the signal
Properties of Etk_Tree:
  • "mode": The current mode of the tree ("tree" or "list" mode)
    • Type: Integer (Etk_Tree_Mode)
    • Access: Read/Write
    • Default Value: ETK_TREE_MODE_LIST
  • "multiple-select": Whether or not several rows of the tree can be selected
    • Type: Boolean
    • Access: Read/Write
    • Default Value: ETK_TRUE
  • "headers-visible": Whether or not the headers of the columns are visible
    • Type: Boolean
    • Access: Read/Write
    • Default Value: ETK_TRUE
  • "rows-height": The height of the rows of the tree
    • Type: Integer
    • Access: Read/Write
    • Default Value: 24

Signals of Etk_Tree_Col:
  • "cell-value-changed": Emitted when the value of a cell of the column is changed
    • Callback: void callback(Etk_Tree_Col *col, Etk_Tree_Row *row, void *data)
      • col: the column containing the cell whose value has been changed
      • row: the row containing the cell whose value has been changed
      • data: the user data set when the callback has been connected to the signal
Properties of Etk_Tree_Col:
  • "title": The title of the column
    • Type: String (char *)
    • Access: Read/Write
    • Default Value: NULL
  • "visible": Whether or not the column is visible
    • Type: Boolean
    • Access: Read/Write
    • Default Value: ETK_TRUE
  • "resizable": Whether or not the column can be resized by the user
    • Type: Boolean
    • Access: Read/Write
    • Default Value: ETK_TRUE
  • "position": The position of the column inside the tree (between 0 and (num_cols - 1))
    • Type: Integer
    • Access: Read/Write
    • Default Value: 0
  • "expand": Whether the column should expand to take up all available width
    • Type: Boolean
    • Access: Read/Write
    • Default Value: ETK_FALSE
  • "width": The current width of the column
    • Type: Boolean
    • Access: Read/Write
    • Default Value: 24
  • "min-width": The minimum width of the column
    • Type: Boolean
    • Access: Read/Write
    • Default Value: 24
  • "align": The horizontal alignment of the objects inside the cells of the column, from 0.0 (left) to 1.0 (right)
    • Type: Float
    • Access: Read/Write
    • Default Value: 0.0


Data Structures

struct  Etk_Tree_Col
 [Object] A column of a tree More...
struct  Etk_Tree_Row
 A row of a tree. More...
struct  Etk_Tree
 [Widget] A widget that displays rows of elements of different types, separated into columns More...

Defines

#define ETK_TREE_TYPE   (etk_tree_type_get())
#define ETK_TREE(obj)   (ETK_OBJECT_CAST((obj), ETK_TREE_TYPE, Etk_Tree))
#define ETK_IS_TREE(obj)   (ETK_OBJECT_CHECK_TYPE((obj), ETK_TREE_TYPE))
#define ETK_TREE_COL_TYPE   (etk_tree_col_type_get())
#define ETK_TREE_COL(obj)   (ETK_OBJECT_CAST((obj), ETK_TREE_COL_TYPE, Etk_Tree_Col))
#define ETK_IS_TREE_COL(obj)   (ETK_OBJECT_CHECK_TYPE((obj), ETK_TREE_COL_TYPE))

Enumerations

enum  Etk_Tree_Mode {
  ETK_TREE_MODE_LIST,
  ETK_TREE_MODE_TREE
}
 The different modes of the tree: List (rows can not have children) or tree (rows can have children). More...

Functions

Etk_Widget * etk_tree_new (void)
 Creates a new tree.
void etk_tree_mode_set (Etk_Tree *tree, Etk_Tree_Mode mode)
 Sets the mode of the tree. The tree must not be built.
Etk_Tree_Mode etk_tree_mode_get (Etk_Tree *tree)
 Gets the mode of tree.
void etk_tree_multiple_select_set (Etk_Tree *tree, Etk_Bool multiple_select)
 Sets whether the user can select several rows of the tree.
Etk_Bool etk_tree_multiple_select_get (Etk_Tree *tree)
 Gets whether or not several rows can be selected in the tree.
void etk_tree_headers_visible_set (Etk_Tree *tree, Etk_Bool headers_visible)
 Sets whether the column-headers should be visible or not.
Etk_Bool etk_tree_headers_visible_get (Etk_Tree *tree)
 Gets whether or not the column-headers are visible.
void etk_tree_rows_height_set (Etk_Tree *tree, int rows_height)
 Sets the height of the rows of the tree.
int etk_tree_rows_height_get (Etk_Tree *tree)
 Gets the height of the rows of the tree.
void etk_tree_build (Etk_Tree *tree)
 Builds the tree. You have to call this function after you have added all the columns and before you add the rows to the tree. Once the tree is built, it can not be unbuilt, and you could not add new columns anymore.
void etk_tree_freeze (Etk_Tree *tree)
 Freezes the tree: the won't be updated until it is thawed. It is useful to add a lot (> 1000) of rows efficiently. To add a few rows, freeze/thaw() is not necessary.
void etk_tree_thaw (Etk_Tree *tree)
 Thaws the tree: the tree will be updated the tree if it was frozen.
Etk_Tree_Col * etk_tree_col_new (Etk_Tree *tree, const char *title, int width, float alignment)
 Inserts a new column into a tree.
int etk_tree_num_cols_get (Etk_Tree *tree)
 Gets the number of columns of the tree.
Etk_Tree_Col * etk_tree_nth_col_get (Etk_Tree *tree, int nth)
 Gets the "nth" column of the tree.
Etk_Tree * etk_tree_col_tree_get (Etk_Tree_Col *col)
 Gets the tree which contains the given column.
void etk_tree_col_model_add (Etk_Tree_Col *col, Etk_Tree_Model *model)
 Adds a model to a column of the tree. You can add several models to the same column in order to combine them. For example, if you want the column's content to be an icon followed by a text, add the "image" model and then the "text" model.
Etk_Widget * etk_tree_col_header_get (Etk_Tree_Col *col)
 Gets the column's header widget. This can be used if you want to detect clicks on it for example. The header widget is an Etk_Button.
void etk_tree_col_title_set (Etk_Tree_Col *col, const char *title)
 Sets the title of the column.
const char * etk_tree_col_title_get (Etk_Tree_Col *col)
 Gets the title of the column.
void etk_tree_col_width_set (Etk_Tree_Col *col, int width)
 Sets the width of the column. It won't be necessarily the visible width of the column since the column can expand.
int etk_tree_col_width_get (Etk_Tree_Col *col)
 Gets the width of the column. TODO: (what if the col expands??).
void etk_tree_col_min_width_set (Etk_Tree_Col *col, int min_width)
 Sets the minimum width of the column. The column can not be smaller than this width.
int etk_tree_col_min_width_get (Etk_Tree_Col *col)
 Gets the minimum width of the column.
void etk_tree_col_resizable_set (Etk_Tree_Col *col, Etk_Bool resizable)
 Sets whether the column can be resized by the user.
Etk_Bool etk_tree_col_resizable_get (Etk_Tree_Col *col)
 Gets whether the column can be resized by the user.
void etk_tree_col_expand_set (Etk_Tree_Col *col, Etk_Bool expand)
 Sets whether the column should expand if there is some free space in the tree.
Etk_Bool etk_tree_col_expand_get (Etk_Tree_Col *col)
 Gets whether the column expands.
void etk_tree_col_alignment_set (Etk_Tree_Col *col, float alignment)
 Sets the horizontal alignment of the objects inside the column.
float etk_tree_col_alignment_get (Etk_Tree_Col *col)
 Gets the horizontal alignment of the objects inside the column.
void etk_tree_col_visible_set (Etk_Tree_Col *col, Etk_Bool visible)
 Sets whether or not the column is visible.
Etk_Bool etk_tree_col_visible_get (Etk_Tree_Col *col)
 Gets whether or not the column is visible.
void etk_tree_col_position_set (Etk_Tree_Col *col, int position)
 Changes the position of the column.
int etk_tree_col_position_get (Etk_Tree_Col *col)
 Gets the position of the column (0 is the first column on the left of the tree, "etk_tree_num_cols_get(tree) - 1" is the last one on the right).
void etk_tree_col_sort_set (Etk_Tree_Col *col, int(*compare_cb)(Etk_Tree_Col *col, Etk_Tree_Row *row1, Etk_Tree_Row *row2, void *data), void *data)
 Sets the sorting function of a column. This function will be called when the header of the column is clicked or when you call etk_tree_col_sort().
Etk_Tree_Row * etk_tree_row_prepend (Etk_Tree *tree, Etk_Tree_Row *parent,...)
Etk_Tree_Row * etk_tree_row_append (Etk_Tree *tree, Etk_Tree_Row *parent,...)
Etk_Tree_Row * etk_tree_row_insert (Etk_Tree *tree, Etk_Tree_Row *parent, Etk_Tree_Row *after,...)
 Inserts a new row after an existing row.
Etk_Tree_Row * etk_tree_row_insert_valist (Etk_Tree *tree, Etk_Tree_Row *parent, Etk_Tree_Row *after, va_list args)
 Inserts a new row after an existing row.
void etk_tree_row_delete (Etk_Tree_Row *row)
 Deletes an existing row and all its children. Note that the row will just be marked as deleted. It will be effectively deleted only during the next iteration of Ecore's main loop. Thus, you can still manipulate safely a row marked as deleted.
void etk_tree_clear (Etk_Tree *tree)
 Deletes all the rows of the tree. Note that the rows will just be marked as deleted. They will be effectively deleted during the next iteration of Ecore's main loop. Thus, you can still manipulate safely the rows immediately after a clear.
void etk_tree_row_fields_set (Etk_Tree_Row *row, Etk_Bool emit_signal,...)
 Sets the values of the cells of the row.
void etk_tree_row_fields_set_valist (Etk_Tree_Row *row, Etk_Bool emit_signal, va_list args)
 Sets the values of the cells of the row.
void etk_tree_row_fields_get (Etk_Tree_Row *row,...)
 Gets the values of the cells of the row.
void etk_tree_row_fields_get_valist (Etk_Tree_Row *row, va_list args)
 Gets the values of the cells of the row.
void etk_tree_row_model_fields_set (Etk_Tree_Row *row, Etk_Bool emit_signal,...)
 Sets the values of the models of the row.
void etk_tree_row_model_fields_set_valist (Etk_Tree_Row *row, Etk_Bool emit_signal, va_list args)
 Sets the values of the models of the row.
void etk_tree_row_model_fields_get (Etk_Tree_Row *row,...)
 Gets the values of the models of the row.
void etk_tree_row_model_fields_get_valist (Etk_Tree_Row *row, va_list args)
 Gets the values of the models of the row.
void etk_tree_row_data_set (Etk_Tree_Row *row, void *data)
 Sets the user data associated to the row. The data could be retrieved later with etk_tree_row_data_get().
void etk_tree_row_data_set_full (Etk_Tree_Row *row, void *data, void(*free_cb)(void *data))
 Sets the user data associated to the row. The data could be retrieved later with etk_tree_row_data_get(). You can also set a function to call to free automatically the data when the row is deleted.
void * etk_tree_row_data_get (Etk_Tree_Row *row)
 Gets the user data associated to the row (previously set with etk_tree_row_data_set()).
Etk_Tree_Row * etk_tree_selected_row_get (Etk_Tree *tree)
 Gets the row that was selected at last.
void etk_tree_select_all (Etk_Tree *tree)
 Selects all the rows of the tree.
void etk_tree_unselect_all (Etk_Tree *tree)
 Unselects all the rows of the tree.
void etk_tree_row_select (Etk_Tree_Row *row)
 Selects a row of the tree.
void etk_tree_row_unselect (Etk_Tree_Row *row)
 Unselects a row of the tree.
Etk_Bool etk_tree_row_is_selected (Etk_Tree_Row *row)
 Gets whether or not the row is selected.
void etk_tree_row_fold (Etk_Tree_Row *row)
 Folds a row of the tree: if the tree is in the "tree" mode, the children of the row won't be visible anymore.
void etk_tree_row_unfold (Etk_Tree_Row *row)
 Unfolds a row of the tree: if the tree is in the "tree" mode, the children of the row will be visible.
Etk_Bool etk_tree_row_is_folded (Etk_Tree_Row *row)
 Gets whether the row is folded or not.
Etk_Tree_Row * etk_tree_first_row_get (Etk_Tree *tree)
 Gets the first row of the tree.
Etk_Tree_Row * etk_tree_last_row_get (Etk_Tree *tree)
 Gets the last row of the tree.
Etk_Tree_Row * etk_tree_row_parent_get (Etk_Tree_Row *row)
 Gets the parent row of the specified row.
Etk_Tree_Row * etk_tree_row_first_child_get (Etk_Tree_Row *row)
 Gets the first child of the specified row.
Etk_Tree_Row * etk_tree_row_last_child_get (Etk_Tree_Row *row)
 Gets the last child of the specified row.
Etk_Tree_Row * etk_tree_row_prev_get (Etk_Tree_Row *row)
 Gets the previous row before the specified row.
Etk_Tree_Row * etk_tree_row_next_get (Etk_Tree_Row *row)
 Gets the next row after the specified row.
Etk_Tree_Row * etk_tree_row_walk_prev (Etk_Tree_Row *row, Etk_Bool include_folded)
 Walks to the previous "visible" row. Unlike etk_tree_row_prev_get(), etk_tree_row_walk_prev() can return a row that is not on the same level as the specified row. It is useful if you want to walk easily through all the rows of the tree.
Etk_Tree_Row * etk_tree_row_walk_next (Etk_Tree_Row *row, Etk_Bool include_folded)
 Walks to the next "visible" row. Unlike etk_tree_row_next_get(), etk_tree_row_walk_next() can return a row that is not on the same level as the specified row. It is useful if you want to walk easily through all the rows of the tree.
Etk_Tree * etk_tree_row_tree_get (Etk_Tree_Row *row)
 Gets the tree which contains the given row.
Etk_Scrolled_View * etk_tree_scrolled_view_get (Etk_Tree *tree)
 Gets the scrolled view of the tree. It can be used to change the scrollbars' policy, or to get the scroll-value.
void etk_tree_row_scroll_to (Etk_Tree_Row *row, Etk_Bool center)
 Scrolls to the given row of the tree, in order to make it visible.


Define Documentation

#define ETK_TREE_TYPE   (etk_tree_type_get())

Gets the type of a tree

#define ETK_TREE ( obj   )     (ETK_OBJECT_CAST((obj), ETK_TREE_TYPE, Etk_Tree))

Casts the object to an Etk_Tree

#define ETK_IS_TREE ( obj   )     (ETK_OBJECT_CHECK_TYPE((obj), ETK_TREE_TYPE))

Check if the object is an Etk_Tree

#define ETK_TREE_COL_TYPE   (etk_tree_col_type_get())

Gets the type of a tree column

#define ETK_TREE_COL ( obj   )     (ETK_OBJECT_CAST((obj), ETK_TREE_COL_TYPE, Etk_Tree_Col))

Casts the object to an Etk_Tree_Col

#define ETK_IS_TREE_COL ( obj   )     (ETK_OBJECT_CHECK_TYPE((obj), ETK_TREE_COL_TYPE))

Check if the object is an Etk_Tree_Col


Enumeration Type Documentation

enum Etk_Tree_Mode

The different modes of the tree: List (rows can not have children) or tree (rows can have children).

Enumerator:
ETK_TREE_MODE_LIST  The rows of a list can not have children (the rows can not be folded/unfolded)
ETK_TREE_MODE_TREE  The rows of a tree can have children


Function Documentation

Etk_Widget * etk_tree_new ( void   ) 

Creates a new tree.

Returns:
Returns the new tree

void etk_tree_mode_set ( Etk_Tree *  tree,
Etk_Tree_Mode  mode 
)

Sets the mode of the tree. The tree must not be built.

Parameters:
tree a tree
mode the mode the tree should use (ETK_TREE_MODE_LIST or ETK_TREE_MODE_TREE)

Etk_Tree_Mode etk_tree_mode_get ( Etk_Tree *  tree  ) 

Gets the mode of tree.

Parameters:
tree a tree
Returns:
Returns the mode of tree (ETK_TREE_MODE_LIST or ETK_TREE_MODE_TREE)

void etk_tree_multiple_select_set ( Etk_Tree *  tree,
Etk_Bool  multiple_select 
)

Sets whether the user can select several rows of the tree.

Parameters:
tree a tree
multiple_select ETK_TRUE to allow the user to select several rows, ETK_FALSE otherwise

Etk_Bool etk_tree_multiple_select_get ( Etk_Tree *  tree  ) 

Gets whether or not several rows can be selected in the tree.

Parameters:
tree a tree
Returns:
ETK_TRUE if several rows can be selected, ETK_FALSE otherwise

void etk_tree_headers_visible_set ( Etk_Tree *  tree,
Etk_Bool  headers_visible 
)

Sets whether the column-headers should be visible or not.

Parameters:
tree a tree
headers_visible ETK_TRUE to show the column-headers, ETK_FALSE to hide them

Etk_Bool etk_tree_headers_visible_get ( Etk_Tree *  tree  ) 

Gets whether or not the column-headers are visible.

Parameters:
tree a tree
Returns:
Returns ETK_TRUE if the column-headers are visible, ETK_FALSE otherwise

void etk_tree_rows_height_set ( Etk_Tree *  tree,
int  rows_height 
)

Sets the height of the rows of the tree.

Parameters:
tree a tree
rows_height the rows height to set. The minimum value is 12

int etk_tree_rows_height_get ( Etk_Tree *  tree  ) 

Gets the height of the rows of the tree.

Parameters:
tree a tree
Returns:
Returns the height of the rows of the tree

void etk_tree_build ( Etk_Tree *  tree  ) 

Builds the tree. You have to call this function after you have added all the columns and before you add the rows to the tree. Once the tree is built, it can not be unbuilt, and you could not add new columns anymore.

Parameters:
tree a tree

void etk_tree_freeze ( Etk_Tree *  tree  ) 

Freezes the tree: the won't be updated until it is thawed. It is useful to add a lot (> 1000) of rows efficiently. To add a few rows, freeze/thaw() is not necessary.

Parameters:
tree a tree
See also:
etk_tree_thaw()

void etk_tree_thaw ( Etk_Tree *  tree  ) 

Thaws the tree: the tree will be updated the tree if it was frozen.

Parameters:
tree a tree
See also:
etk_tree_freeze()

Etk_Tree_Col * etk_tree_col_new ( Etk_Tree *  tree,
const char *  title,
int  width,
float  alignment 
)

Inserts a new column into a tree.

Parameters:
tree a tree
title the tile of the column
width the requested width of the column. It won't be necessary the visible width of the column since it can be expanded to fit the available space
alignment the horizontal alignment of the objects inside the column, from 0.0 (left alignment) to 1.0 (right alignment)
Returns:
Returns the new column

int etk_tree_num_cols_get ( Etk_Tree *  tree  ) 

Gets the number of columns of the tree.

Parameters:
tree a tree
Returns:
Returns the number of columns of the tree

Etk_Tree_Col * etk_tree_nth_col_get ( Etk_Tree *  tree,
int  nth 
)

Gets the "nth" column of the tree.

Parameters:
tree a tree
nth the index of the column to get. Since the columns can be reordered or hidden, nth corresponds to the "nth" created column, which is not necessarily the "nth" visible column
Returns:
Returns the "nth" column of the tree

Etk_Tree * etk_tree_col_tree_get ( Etk_Tree_Col *  col  ) 

Gets the tree which contains the given column.

Parameters:
col a column
Returns:
Returns the tree which contains the given column, or NULL on failure

void etk_tree_col_model_add ( Etk_Tree_Col *  col,
Etk_Tree_Model *  model 
)

Adds a model to a column of the tree. You can add several models to the same column in order to combine them. For example, if you want the column's content to be an icon followed by a text, add the "image" model and then the "text" model.

Parameters:
col a column
model the model to add to the column col
Warning:
the number of models per column is limited to 5

Etk_Widget * etk_tree_col_header_get ( Etk_Tree_Col *  col  ) 

Gets the column's header widget. This can be used if you want to detect clicks on it for example. The header widget is an Etk_Button.

Parameters:
col a column
Returns:
Returns the column's header widget

void etk_tree_col_title_set ( Etk_Tree_Col *  col,
const char *  title 
)

Sets the title of the column.

Parameters:
col a column of a tree
title the title to set

const char * etk_tree_col_title_get ( Etk_Tree_Col *  col  ) 

Gets the title of the column.

Parameters:
col a column of a tree
Returns:
Returns the title of the column

void etk_tree_col_width_set ( Etk_Tree_Col *  col,
int  width 
)

Sets the width of the column. It won't be necessarily the visible width of the column since the column can expand.

Parameters:
col a column of a tree
width the width to set

int etk_tree_col_width_get ( Etk_Tree_Col *  col  ) 

Gets the width of the column. TODO: (what if the col expands??).

Parameters:
col a column of a tree
Returns:
Returns the width of the column

void etk_tree_col_min_width_set ( Etk_Tree_Col *  col,
int  min_width 
)

Sets the minimum width of the column. The column can not be smaller than this width.

Parameters:
col a column of a tree
min_width the minimum width to set. -1 to use the default value

int etk_tree_col_min_width_get ( Etk_Tree_Col *  col  ) 

Gets the minimum width of the column.

Parameters:
col a column of a tree
Returns:
Returns the minimum width of the column

void etk_tree_col_resizable_set ( Etk_Tree_Col *  col,
Etk_Bool  resizable 
)

Sets whether the column can be resized by the user.

Parameters:
col a column of a tree
resizable ETK_TRUE to make the column resizable, ETK_FALSE otherwise

Etk_Bool etk_tree_col_resizable_get ( Etk_Tree_Col *  col  ) 

Gets whether the column can be resized by the user.

Parameters:
col a column of a tree
Returns:
Returns ETK_TRUE if the column is resizable

void etk_tree_col_expand_set ( Etk_Tree_Col *  col,
Etk_Bool  expand 
)

Sets whether the column should expand if there is some free space in the tree.

Parameters:
col a column of a tree
expand ETK_TRUE to make the column expand, ETK_FALSE otherwise

Etk_Bool etk_tree_col_expand_get ( Etk_Tree_Col *  col  ) 

Gets whether the column expands.

Parameters:
col a column of a tree
Returns:
Returns ETK_TRUE if the column expands, ETK_FALSE otherwise

void etk_tree_col_alignment_set ( Etk_Tree_Col *  col,
float  alignment 
)

Sets the horizontal alignment of the objects inside the column.

Parameters:
col a column of a tree
alignment the horizontal alignment to use, from 0.0 (left alignment) to 1.0 (right alignment)

float etk_tree_col_alignment_get ( Etk_Tree_Col *  col  ) 

Gets the horizontal alignment of the objects inside the column.

Parameters:
col a column of a tree
Returns:
Returns the horizontal alignment of the column, from 0.0 (left alignment) to 1.0 (right alignment)

void etk_tree_col_visible_set ( Etk_Tree_Col *  col,
Etk_Bool  visible 
)

Sets whether or not the column is visible.

Parameters:
col a column of a tree
visible ETK_TRUE to show the column, ETK_FALSE to hide it

Etk_Bool etk_tree_col_visible_get ( Etk_Tree_Col *  col  ) 

Gets whether or not the column is visible.

Parameters:
col a column of a tree
Returns:
Returns ETK_TRUE if the column is visible

void etk_tree_col_position_set ( Etk_Tree_Col *  col,
int  position 
)

Changes the position of the column.

Parameters:
col a column of a tree
position the new position the column should take (0 is the first column on the left of the tree, "etk_tree_num_cols_get(tree) - 1" is the last one on the right)

int etk_tree_col_position_get ( Etk_Tree_Col *  col  ) 

Gets the position of the column (0 is the first column on the left of the tree, "etk_tree_num_cols_get(tree) - 1" is the last one on the right).

Parameters:
col a column of a tree
Returns:
Returns the position of the column

void etk_tree_col_sort_set ( Etk_Tree_Col *  col,
int(*)(Etk_Tree_Col *col, Etk_Tree_Row *row1, Etk_Tree_Row *row2, void *data)  compare_cb,
void *  data 
)

Sets the sorting function of a column. This function will be called when the header of the column is clicked or when you call etk_tree_col_sort().

Parameters:
col a column of a tree
compare_cb the function to call to compare two rows. It should return a negative value if the cell of "row1" has a lower value than the cell of "row2", 0 if they have the same value, and a positive value if the cell of "row2" has a greater value than the cell of "row1"
data a pointer that will be passed to compare_cb when it is called

Etk_Tree_Row * etk_tree_row_prepend ( Etk_Tree *  tree,
Etk_Tree_Row *  parent,
  ... 
)

Inserts a new row at the beginning of the tree (if parent is NULL) or as the first child of an existing row (if parent is not NULL and if the tree is in the "tree" mode)

Parameters:
tree a tree
parent the parent row of the row to insert. NULL means the row will be inserted at the tree's root
... an "Etk_Tree_Col *" followed by the value of the cell, then any number of "Etk_Tree_Col *"/Value pairs, and terminated by NULL. Note that, according to the model used by the column, a cell value can use several parameters
Returns:
Returns the new row, or NULL on failure

Etk_Tree_Row * etk_tree_row_append ( Etk_Tree *  tree,
Etk_Tree_Row *  parent,
  ... 
)

Inserts a new row at the end of the tree (if parent is NULL) or as the last child of an existing row (if parent is not NULL and if the tree is in the "tree" mode)

Parameters:
tree a tree
parent the parent row of the row to insert. NULL means the row will be inserted at the tree's root
... an "Etk_Tree_Col *" followed by the value of the cell, then any number of "Etk_Tree_Col *"/Value pairs, and terminated by NULL. Note that, according to the model used by the column, a cell value can use several parameters
Returns:
Returns the new row, or NULL on failure

Etk_Tree_Row * etk_tree_row_insert ( Etk_Tree *  tree,
Etk_Tree_Row *  parent,
Etk_Tree_Row *  after,
  ... 
)

Inserts a new row after an existing row.

Parameters:
tree a tree
parent the parent row of the row to insert. If after is not NULL, parent is optionnal (the parent of the new row will be the parent of after)
after the row after which the new row will be inserted. NULL means the new row will be inserted at the beginning of the tree (if parent is NULL) or as the first child of parent (if parent is not NULL and if the tree is in the "tree" mode)
... an "Etk_Tree_Col *" followed by the value of the cell, then any number of "Etk_Tree_Col *"/Value pairs, and terminated by NULL. Note that, according to the model used by the column, a cell value can use several parameters
Returns:
Returns the new row, or NULL on failure

Etk_Tree_Row * etk_tree_row_insert_valist ( Etk_Tree *  tree,
Etk_Tree_Row *  parent,
Etk_Tree_Row *  after,
va_list  args 
)

Inserts a new row after an existing row.

Parameters:
tree a tree
parent the parent row of the row to insert. If after is not NULL, parent is optionnal (the parent of the new row will be the parent of after)
after the row after which the new row will be inserted. NULL means the new row will be inserted at the beginning of the tree (if parent is NULL) or as the first child of parent (if parent is not NULL and if the tree is in the "tree" mode)
args an "Etk_Tree_Col *" followed by the value of the cell, then any number of "Etk_Tree_Col *"/Value pairs, and terminated by NULL. Note that, according to the model used by the column, a cell value can use several parameters
Returns:
Returns the new row, or NULL on failure

void etk_tree_row_delete ( Etk_Tree_Row *  row  ) 

Deletes an existing row and all its children. Note that the row will just be marked as deleted. It will be effectively deleted only during the next iteration of Ecore's main loop. Thus, you can still manipulate safely a row marked as deleted.

Parameters:
row the row to delete

void etk_tree_clear ( Etk_Tree *  tree  ) 

Deletes all the rows of the tree. Note that the rows will just be marked as deleted. They will be effectively deleted during the next iteration of Ecore's main loop. Thus, you can still manipulate safely the rows immediately after a clear.

void etk_tree_row_fields_set ( Etk_Tree_Row *  row,
Etk_Bool  emit_signal,
  ... 
)

Sets the values of the cells of the row.

Parameters:
row a row of the tree
emit_signal whether or not the "cell-value-changed" signal should be emitted on the modified columns. Most of the time, the signal don't need to be emitted (so emit_signal should be ETK_FALSE), except if you have a callback connected on this signal
... an "Etk_Tree_Col *" followed by the value of the cell, then any number of "Etk_Tree_Col *"/Value pairs, and terminated by NULL. Note that, according to the models used by the column, a cell value can use several parameters

void etk_tree_row_fields_set_valist ( Etk_Tree_Row *  row,
Etk_Bool  emit_signal,
va_list  args 
)

Sets the values of the cells of the row.

Parameters:
row a row of the tree
emit_signal whether or not the "cell-value-changed" signal should be emitted on the modified columns. Most of the time, the signal don't need to be emitted (so emit_signal should be ETK_FALSE), except if you have a callback connected on this signal
args an "Etk_Tree_Col *" followed by the value of the cell, then any number of "Etk_Tree_Col *"/Value pairs, and terminated by NULL. Note that, according to the models used by the column, a cell value can use several parameters

void etk_tree_row_fields_get ( Etk_Tree_Row *  row,
  ... 
)

Gets the values of the cells of the row.

Parameters:
row a row of the tree
... an "Etk_Tree_Col *" followed by the location where to store the value of the cell, then any number of "Etk_Tree_Col *"/Location pairs, and terminated by NULL. Note that some models may require several locations to store the cell value

void etk_tree_row_fields_get_valist ( Etk_Tree_Row *  row,
va_list  args 
)

Gets the values of the cells of the row.

Parameters:
row a row of the tree
args an "Etk_Tree_Col *" followed by the location where to store the value of the cell, then any number of "Etk_Tree_Col *"/Location pairs, and terminated by NULL. Note that some models may require several locations to store the cell value

void etk_tree_row_model_fields_set ( Etk_Tree_Row *  row,
Etk_Bool  emit_signal,
  ... 
)

Sets the values of the models of the row.

Parameters:
row a row of the tree
emit_signal whether or not the "cell-value-changed" signal should be emitted on the modified columns. Most of the time, the signal don't need to be emitted (so emit_signal should be ETK_FALSE), except if you have a callback connected on this signal
... an "Etk_Tree_Model *" followed by the value of the model, then any number of "Etk_Tree_Model *"/Value pairs, and terminated by NULL. Note that, according to the models, a cell value can use several parameters

void etk_tree_row_model_fields_set_valist ( Etk_Tree_Row *  row,
Etk_Bool  emit_signal,
va_list  args 
)

Sets the values of the models of the row.

Parameters:
row a row of the tree
emit_signal whether or not the "cell-value-changed" signal should be emitted on the modified columns. Most of the time, the signal don't need to be emitted (so emit_signal should be ETK_FALSE), except if you have a callback connected on this signal
args an "Etk_Tree_Model *" followed by the value of the model, then any number of "Etk_Tree_Model *"/Value pairs, and terminated by NULL. Note that, according to the models, a cell value can use several parameters

void etk_tree_row_model_fields_get ( Etk_Tree_Row *  row,
  ... 
)

Gets the values of the models of the row.

Parameters:
row a row of the tree
... an "Etk_Tree_Model *" followed by the location where to store the value of this model, then any number of "Etk_Tree_Model *"/Location pairs, and terminated by NULL. Note that some models may require several locations to store their value

void etk_tree_row_model_fields_get_valist ( Etk_Tree_Row *  row,
va_list  args 
)

Gets the values of the models of the row.

Parameters:
row a row of the tree
args an "Etk_Tree_Model *" followed by the location where to store the value of this model, then any number of "Etk_Tree_Model *"/Location pairs, and terminated by NULL. Note that some models may require several locations to store their value

void etk_tree_row_data_set ( Etk_Tree_Row *  row,
void *  data 
)

Sets the user data associated to the row. The data could be retrieved later with etk_tree_row_data_get().

Parameters:
row a row of the tree
data the data to associate to the row
Note:
This is equivalent to etk_tree_row_data_set_full(row, data, NULL);

void etk_tree_row_data_set_full ( Etk_Tree_Row *  row,
void *  data,
void(*)(void *data)  free_cb 
)

Sets the user data associated to the row. The data could be retrieved later with etk_tree_row_data_get(). You can also set a function to call to free automatically the data when the row is deleted.

Parameters:
row a row of the tree
data the data to associate to the row
free_cb a function to call to free the data automatically when the row is deleted

void * etk_tree_row_data_get ( Etk_Tree_Row *  row  ) 

Gets the user data associated to the row (previously set with etk_tree_row_data_set()).

Parameters:
row a row of the tree
Returns:
Returns the user data associated to the row

Etk_Tree_Row * etk_tree_selected_row_get ( Etk_Tree *  tree  ) 

Gets the row that was selected at last.

Parameters:
tree a tree
Returns:
Returns the row that was selected at last, or NULL if no row is selected
Note:
If you want to get all the selected rows (if multiple-selection is enabled), you have to walk through all the rows, and see if they are selected with etk_tree_row_is_selected()

void etk_tree_select_all ( Etk_Tree *  tree  ) 

Selects all the rows of the tree.

Parameters:
tree a tree
Note:
When you call etk_tree_select_all(), for performance reasons, the signal "row-selected" is not emitted for each row of the tree. Only the signal "all-selected" is emitted on the tree.

void etk_tree_unselect_all ( Etk_Tree *  tree  ) 

Unselects all the rows of the tree.

Parameters:
tree a tree
Note:
When you call etk_tree_unselect_all(), for performance reasons, the signal "row-unselected" is not emitted for each row of the tree. Only the signal "all-unselected" is emitted on the tree.

void etk_tree_row_select ( Etk_Tree_Row *  row  ) 

Selects a row of the tree.

Parameters:
row the row to select

void etk_tree_row_unselect ( Etk_Tree_Row *  row  ) 

Unselects a row of the tree.

Parameters:
row the row to unselect

Etk_Bool etk_tree_row_is_selected ( Etk_Tree_Row *  row  ) 

Gets whether or not the row is selected.

Parameters:
row a row
Returns:
Returns ETK_TRUE if the row is selected, ETK_FALSE otherwise

void etk_tree_row_fold ( Etk_Tree_Row *  row  ) 

Folds a row of the tree: if the tree is in the "tree" mode, the children of the row won't be visible anymore.

Parameters:
row the row to fold

void etk_tree_row_unfold ( Etk_Tree_Row *  row  ) 

Unfolds a row of the tree: if the tree is in the "tree" mode, the children of the row will be visible.

Parameters:
row the row to unfold

Etk_Bool etk_tree_row_is_folded ( Etk_Tree_Row *  row  ) 

Gets whether the row is folded or not.

Parameters:
row a row
Returns:
Returns ETK_TRUE if the row is folded, ETK_FALSE otherwise

Etk_Tree_Row * etk_tree_first_row_get ( Etk_Tree *  tree  ) 

Gets the first row of the tree.

Parameters:
tree a tree
Returns:
Returns the first row of the tree, or NULL if the tree is empty

Etk_Tree_Row * etk_tree_last_row_get ( Etk_Tree *  tree  ) 

Gets the last row of the tree.

Parameters:
tree a tree
Returns:
Returns the last row of the tree, or NULL if the tree is empty

Etk_Tree_Row * etk_tree_row_parent_get ( Etk_Tree_Row *  row  ) 

Gets the parent row of the specified row.

Parameters:
row a row
Returns:
Returns the parent row of the specified row, or NULL if the row is at the tree's root

Etk_Tree_Row * etk_tree_row_first_child_get ( Etk_Tree_Row *  row  ) 

Gets the first child of the specified row.

Parameters:
row a row
Returns:
Returns the first child of the row

Etk_Tree_Row * etk_tree_row_last_child_get ( Etk_Tree_Row *  row  ) 

Gets the last child of the specified row.

Parameters:
row a row
Returns:
Returns the last child of the row

Etk_Tree_Row * etk_tree_row_prev_get ( Etk_Tree_Row *  row  ) 

Gets the previous row before the specified row.

Parameters:
row a row
Returns:
Returns the previous row before the specified row, or NULL if the row is the first row of its parent
Note:
This function does not return the previous visible row, but only the previous row that is on the same level as the specified row. So if some rows of the tree have children, you'll have to use etk_tree_row_walk_prev() if you want to walk through all the rows of the tree.
See also:
etk_tree_row_walk_prev()

Etk_Tree_Row * etk_tree_row_next_get ( Etk_Tree_Row *  row  ) 

Gets the next row after the specified row.

Parameters:
row a row
Returns:
Returns the next row after the specified row, or NULL if the row is the last row of its parent
Note:
This function does not return the next visible row, but only the next row that is on the same level as the specified row. So if some rows of the tree have children, you'll have to use etk_tree_row_walk_next() if you want to walk through all the rows of the tree.
See also:
etk_tree_row_walk_next()

Etk_Tree_Row * etk_tree_row_walk_prev ( Etk_Tree_Row *  row,
Etk_Bool  include_folded 
)

Walks to the previous "visible" row. Unlike etk_tree_row_prev_get(), etk_tree_row_walk_prev() can return a row that is not on the same level as the specified row. It is useful if you want to walk easily through all the rows of the tree.

Parameters:
row a row
include_folded if include_folded is ETK_TRUE, the function will return a row, even if this row is a child of a folded row
Returns:
Returns the previous "visible" row
Note:
if the tree is in the list mode, this is equivalent to etk_tree_row_prev_get(row)

Etk_Tree_Row * etk_tree_row_walk_next ( Etk_Tree_Row *  row,
Etk_Bool  include_folded 
)

Walks to the next "visible" row. Unlike etk_tree_row_next_get(), etk_tree_row_walk_next() can return a row that is not on the same level as the specified row. It is useful if you want to walk easily through all the rows of the tree.

Parameters:
row a row
include_folded if include_folded is ETK_TRUE, the function will return a row, even if this row is a child of a folded row
Returns:
Returns the next "visible" row
Note:
if the tree is in the list mode, this is equivalent to etk_tree_row_next_get(row)

Etk_Tree * etk_tree_row_tree_get ( Etk_Tree_Row *  row  ) 

Gets the tree which contains the given row.

Parameters:
row a row
Returns:
Returns the tree which contains the given row, or NULL on failure

Etk_Scrolled_View * etk_tree_scrolled_view_get ( Etk_Tree *  tree  ) 

Gets the scrolled view of the tree. It can be used to change the scrollbars' policy, or to get the scroll-value.

Parameters:
tree a tree
Returns:
Returns the scrolled view of the tree

void etk_tree_row_scroll_to ( Etk_Tree_Row *  row,
Etk_Bool  center 
)

Scrolls to the given row of the tree, in order to make it visible.

Parameters:
row the row to scroll to
center whether or not the row should be centered in the view