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: Etk_Bool 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: Etk_Bool 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: Etk_Bool 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: Etk_Bool 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: Etk_Bool 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: Etk_Bool 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: Etk_Bool 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: Etk_Bool 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: Etk_Bool 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: Etk_Bool 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
  • "column-separators-visible": Whether or not the columns are separated by a visible vertical separator
    • Type: Boolean
    • Access: Read/Write
    • Default Value: ETK_TRUE
  • "alternating-row-colors": Whether or not the row-colors alternate (e.g darker even rows)
    • 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: Etk_Bool 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_column_separators_visible_set (Etk_Tree *tree, Etk_Bool col_separators_visible)
 Sets whether the columns should be separated by a visible vertical separator.
Etk_Bool etk_tree_column_separators_visible_get (Etk_Tree *tree)
 Gets whether or not the columns are separated by a visible vertical separator.
void etk_tree_alternating_row_colors_set (Etk_Tree *tree, Etk_Bool alternating_row_colors)
 Sets whether the row-colors alternate (e.g. the odd rows are darker than the even rows).
Etk_Bool etk_tree_alternating_row_colors_get (Etk_Tree *tree)
 Gets whether the row-colors of the tree alternate.
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.
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().
void etk_tree_col_sort (Etk_Tree_Col *col, Etk_Bool ascending)
 Sorts the rows of the tree according to the comparison function of the given column. You can set the comparison function with etk_tree_col_sort_set(). If no comparison function is associated to the column, this function will have no effect.
void etk_tree_col_sort_full (Etk_Tree_Col *col, int(*compare_cb)(Etk_Tree_Col *col, Etk_Tree_Row *row1, Etk_Tree_Row *row2, void *data), void *data, Etk_Bool ascending)
 Sorts the rows of the tree according to the given comparison function.
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_sorted (Etk_Tree *tree, Etk_Tree_Row *parent,...)
 Insert a new row in a sorted column at the right place.
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_Tree_Row * etk_tree_row_get_at_xy (Etk_Tree *tree, int x, int y)
 Gets the row that is at the absolute position ( x, y ).
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

Referenced by etk_tree_new().

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

Casts the object to an Etk_Tree

Referenced by etk_filechooser_widget_current_folder_set(), etk_filechooser_widget_select_multiple_get(), etk_filechooser_widget_select_multiple_set(), etk_filechooser_widget_selected_file_get(), and etk_filechooser_widget_selected_files_get().

#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

Referenced by etk_tree_col_new().

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

Casts the object to an Etk_Tree_Col

Referenced by etk_tree_col_new().

#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

References ETK_TREE_TYPE, and etk_widget_new().

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)

References built, ETK_OBJECT, etk_object_notify(), ETK_WARNING, and mode.

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)

References ETK_TREE_MODE_LIST, and mode.

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

References ETK_OBJECT, etk_object_notify(), etk_tree_unselect_all(), and multiple_select.

Referenced by etk_filechooser_widget_select_multiple_set().

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

References multiple_select.

Referenced by etk_filechooser_widget_select_multiple_get().

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

References ETK_OBJECT, etk_object_notify(), ETK_WIDGET, etk_widget_redraw_queue(), and headers_visible.

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

References headers_visible.

void etk_tree_column_separators_visible_set ( Etk_Tree *  tree,
Etk_Bool  col_separators_visible 
)

Sets whether the columns should be separated by a visible vertical separator.

Parameters:
tree a tree
col_separators_visible ETK_TRUE to show the vertical separators, ETK_FALSE to hide them

References col_separators_visible, ETK_OBJECT, etk_object_notify(), ETK_WIDGET, and etk_widget_redraw_queue().

Etk_Bool etk_tree_column_separators_visible_get ( Etk_Tree *  tree  ) 

Gets whether or not the columns are separated by a visible vertical separator.

Parameters:
tree a tree
Returns:
Returns ETK_TRUE if the vertical separators are shown, ETK_FALSE otherwise

References col_separators_visible.

void etk_tree_alternating_row_colors_set ( Etk_Tree *  tree,
Etk_Bool  alternating_row_colors 
)

Sets whether the row-colors alternate (e.g. the odd rows are darker than the even rows).

Parameters:
tree a tree
alternating_row_colors ETK_TRUE to make the row-colors alternate, ETK_FALSE otherwise

References alternating_row_colors, ETK_OBJECT, etk_object_notify(), ETK_WIDGET, and etk_widget_redraw_queue().

Etk_Bool etk_tree_alternating_row_colors_get ( Etk_Tree *  tree  ) 

Gets whether the row-colors of the tree alternate.

Parameters:
tree a tree
Returns:
Returns ETK_TRUE if the row-colors alternate, ETK_FALSE otherwise

References alternating_row_colors.

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

References ETK_MAX, ETK_OBJECT, etk_object_notify(), etk_range_increments_set(), ETK_SCROLLED_VIEW, etk_scrolled_view_vscrollbar_get(), etk_signal_emit(), ETK_WIDGET, etk_widget_redraw_queue(), rows_height, scroll_content, and scrolled_view.

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

References rows_height.

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

References built.

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()

References frozen.

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()

References ETK_OBJECT, etk_signal_emit(), ETK_WIDGET, etk_widget_redraw_queue(), frozen, and scroll_content.

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

References built, columns, ETK_BUTTON_TYPE, etk_object_new(), ETK_TREE_COL, ETK_TREE_COL_TYPE, ETK_WARNING, ETK_WIDGET, etk_widget_new(), etk_widget_parent_set(), Etk_Tree_Col::header, Etk_Tree_Col::id, num_cols, Etk_Tree_Col::position, scroll_content, Etk_Tree_Col::tree, and tree_contains_headers.

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

References num_cols.

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

References columns, and num_cols.

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

References Etk_Tree_Col::tree.

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

References built, Etk_Tree_Model::col, ETK_WARNING, Etk_Tree_Model::index, Etk_Tree_Col::models, Etk_Tree_Col::num_models, Etk_Tree_Model::tree, and Etk_Tree_Col::tree.

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

References Etk_Tree_Col::header.

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

References ETK_BUTTON, etk_button_label_set(), ETK_OBJECT, etk_object_notify(), and Etk_Tree_Col::header.

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

References ETK_BUTTON, etk_button_label_get(), and Etk_Tree_Col::header.

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

References ETK_MAX, ETK_OBJECT, etk_object_notify(), etk_signal_emit(), ETK_WIDGET, etk_widget_redraw_queue(), Etk_Tree_Col::min_width, scroll_content, Etk_Tree_Col::tree, and Etk_Tree_Col::width.

Referenced by etk_tree_col_min_width_set().

int etk_tree_col_width_get ( Etk_Tree_Col *  col  ) 

Gets the width of the column.

Parameters:
col a column of a tree
Returns:
Returns the width of the column
Note:
This function doesn't take into account the extra-width if the column expands.

References Etk_Tree_Col::width.

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

References ETK_MAX, ETK_OBJECT, etk_object_notify(), etk_tree_col_width_set(), Etk_Tree_Col::min_width, and Etk_Tree_Col::width.

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

References Etk_Tree_Col::min_width.

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

References ETK_OBJECT, etk_object_notify(), and Etk_Tree_Col::resizable.

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

References Etk_Tree_Col::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

References ETK_OBJECT, etk_object_notify(), ETK_WIDGET, etk_widget_redraw_queue(), Etk_Tree_Col::expand, and Etk_Tree_Col::tree.

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

References Etk_Tree_Col::expand.

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)

References Etk_Tree_Col::align, ETK_CLAMP, ETK_OBJECT, etk_object_notify(), ETK_WIDGET, etk_widget_redraw_queue(), and Etk_Tree_Col::tree.

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)

References Etk_Tree_Col::align.

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

References ETK_OBJECT, etk_object_notify(), etk_signal_emit(), ETK_WIDGET, etk_widget_redraw_queue(), scroll_content, Etk_Tree_Col::tree, and Etk_Tree_Col::visible.

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

References Etk_Tree_Col::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)

References columns, ETK_CLAMP, ETK_OBJECT, etk_object_notify(), ETK_WIDGET, etk_widget_redraw_queue(), num_cols, Etk_Tree_Col::position, and Etk_Tree_Col::tree.

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

References Etk_Tree_Col::position.

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

References Etk_Tree_Col::compare_cb, Etk_Tree_Col::data, and Etk_Tree_Col::sort.

void etk_tree_col_sort ( Etk_Tree_Col *  col,
Etk_Bool  ascending 
)

Sorts the rows of the tree according to the comparison function of the given column. You can set the comparison function with etk_tree_col_sort_set(). If no comparison function is associated to the column, this function will have no effect.

Parameters:
col the column according to which the tree's rows should be sorted
ascending Etk_True to perform an ascendant sort, ETK_FALSE to perform a descendant sort

References Etk_Tree_Col::compare_cb, Etk_Tree_Col::data, etk_tree_col_sort_full(), and Etk_Tree_Col::sort.

void etk_tree_col_sort_full ( Etk_Tree_Col *  col,
int(*)(Etk_Tree_Col *col, Etk_Tree_Row *row1, Etk_Tree_Row *row2, void *data)  compare_cb,
void *  data,
Etk_Bool  ascending 
)

Sorts the rows of the tree according to the given comparison function.

Parameters:
col the column that will be passed to compare_cb when it is called
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 "row1" has a greater value than the cell of "row2"
data a pointer that will be passed to compare_cb when it is called
ascending Etk_True to perform an ascendant sort, ETK_FALSE to perform a descendant sort

References etk_tree_row_walk_next(), ETK_WIDGET, etk_widget_redraw_queue(), Etk_Tree_Row::first_child, Etk_Tree_Row::last_child, Etk_Tree_Col::last_compare_cb, Etk_Tree_Row::parent, root, Etk_Tree_Col::sort, sorted_asc, sorted_col, and Etk_Tree_Col::tree.

Referenced by etk_tree_col_sort().

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

References etk_tree_row_insert_valist().

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

References etk_tree_row_insert_valist(), Etk_Tree_Row::last_child, and root.

Referenced by etk_filechooser_widget_current_folder_set().

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

References etk_tree_row_insert_valist().

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

Insert a new row in a sorted column at the right place.

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)
... 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
Warning:
It will only work if the tree is already sorted.

References Etk_Tree_Col::compare_cb, Etk_Tree_Col::data, etk_tree_row_insert_valist(), Etk_Tree_Row::first_child, Etk_Tree_Row::last_child, Etk_Tree_Row::next, Etk_Tree_Row::num_children, Etk_Tree_Row::prev, root, Etk_Tree_Col::sort, sorted_asc, and sorted_col.

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

References built, Etk_Tree_Model::cell_data_init, Etk_Tree_Model::cell_data_size, Etk_Tree_Row::cells_data, columns, Etk_Tree_Row::data, Etk_Tree_Row::data_free_cb, Etk_Tree_Row::delete_me, ETK_OBJECT, etk_signal_emit(), etk_tree_row_fields_set_valist(), ETK_WARNING, ETK_WIDGET, etk_widget_redraw_queue(), Etk_Tree_Row::first_child, frozen, Etk_Tree_Row::last_child, Etk_Tree_Col::models, Etk_Tree_Row::next, Etk_Tree_Row::num_children, num_cols, Etk_Tree_Col::num_models, Etk_Tree_Row::num_visible_children, Etk_Tree_Row::parent, Etk_Tree_Row::prev, root, scroll_content, Etk_Tree_Row::selected, sorted_col, total_rows, Etk_Tree_Row::tree, and Etk_Tree_Row::unfolded.

Referenced by etk_tree_row_append(), etk_tree_row_insert(), etk_tree_row_insert_sorted(), and etk_tree_row_prepend().

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

References Etk_Tree_Row::delete_me, ETK_OBJECT, etk_signal_emit(), ETK_WIDGET, etk_widget_redraw_queue(), frozen, scroll_content, and Etk_Tree_Row::tree.

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.

References ETK_OBJECT, etk_signal_emit(), ETK_WIDGET, etk_widget_redraw_queue(), Etk_Tree_Row::first_child, root, and scroll_content.

Referenced by etk_filechooser_widget_current_folder_set().

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

References etk_tree_row_fields_set_valist().

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

References Etk_Tree_Model::cell_data_set, Etk_Tree_Row::cells_data, ETK_OBJECT, etk_signal_emit(), ETK_WIDGET, etk_widget_redraw_queue(), frozen, Etk_Tree_Col::id, Etk_Tree_Col::models, Etk_Tree_Col::num_models, sorted_col, and Etk_Tree_Row::tree.

Referenced by etk_tree_row_fields_set(), and etk_tree_row_insert_valist().

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

References etk_tree_row_fields_get_valist().

Referenced by etk_filechooser_widget_selected_file_get(), and etk_filechooser_widget_selected_files_get().

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

References Etk_Tree_Model::cell_data_get, Etk_Tree_Row::cells_data, Etk_Tree_Col::id, Etk_Tree_Col::models, and Etk_Tree_Col::num_models.

Referenced by etk_tree_row_fields_get().

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

References etk_tree_row_model_fields_set_valist().

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

References Etk_Tree_Model::cell_data_set, Etk_Tree_Row::cells_data, Etk_Tree_Model::col, ETK_OBJECT, etk_signal_emit(), ETK_WIDGET, etk_widget_redraw_queue(), frozen, Etk_Tree_Col::id, Etk_Tree_Model::index, and Etk_Tree_Row::tree.

Referenced by etk_tree_row_model_fields_set().

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

References etk_tree_row_model_fields_get_valist().

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

References Etk_Tree_Model::cell_data_get, Etk_Tree_Row::cells_data, Etk_Tree_Model::col, Etk_Tree_Col::id, and Etk_Tree_Model::index.

Referenced by etk_tree_row_model_fields_get().

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);

References etk_tree_row_data_set_full().

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

References Etk_Tree_Row::data, and Etk_Tree_Row::data_free_cb.

Referenced by etk_tree_row_data_set().

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

References Etk_Tree_Row::data.

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()

References last_selected_row, and Etk_Tree_Row::selected.

Referenced by etk_filechooser_widget_selected_file_get().

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.

References ETK_OBJECT, etk_signal_emit(), etk_tree_row_walk_next(), ETK_WIDGET, etk_widget_redraw_queue(), Etk_Tree_Row::first_child, root, and Etk_Tree_Row::selected.

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.

References ETK_OBJECT, etk_signal_emit(), etk_tree_row_walk_next(), ETK_WIDGET, etk_widget_redraw_queue(), Etk_Tree_Row::first_child, root, and Etk_Tree_Row::selected.

Referenced by etk_tree_multiple_select_set().

void etk_tree_row_select ( Etk_Tree_Row *  row  ) 

Selects a row of the tree.

Parameters:
row the row to select

References Etk_Tree_Row::delete_me, ETK_MODIFIER_NONE, Etk_Tree_Row::selected, and Etk_Tree_Row::tree.

void etk_tree_row_unselect ( Etk_Tree_Row *  row  ) 

Unselects a row of the tree.

Parameters:
row the row to unselect

References Etk_Tree_Row::delete_me, ETK_OBJECT, etk_signal_emit(), ETK_WIDGET, etk_widget_redraw_queue(), frozen, Etk_Tree_Row::selected, and Etk_Tree_Row::tree.

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

References Etk_Tree_Row::selected.

Referenced by etk_filechooser_widget_selected_files_get().

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

References ETK_OBJECT, etk_signal_emit(), ETK_TREE_MODE_TREE, ETK_WIDGET, etk_widget_redraw_queue(), frozen, mode, Etk_Tree_Row::num_visible_children, Etk_Tree_Row::parent, scroll_content, Etk_Tree_Row::tree, and Etk_Tree_Row::unfolded.

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

References ETK_OBJECT, etk_signal_emit(), ETK_TREE_MODE_TREE, ETK_WIDGET, etk_widget_redraw_queue(), Etk_Tree_Row::first_child, frozen, mode, Etk_Tree_Row::next, Etk_Tree_Row::num_visible_children, Etk_Tree_Row::parent, scroll_content, Etk_Tree_Row::tree, and Etk_Tree_Row::unfolded.

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

References Etk_Tree_Row::unfolded.

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

References Etk_Tree_Row::first_child, and root.

Referenced by etk_filechooser_widget_selected_files_get(), etk_tree_row_get_at_xy(), and etk_tree_row_scroll_to().

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

References Etk_Tree_Row::last_child, and root.

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

References Etk_Tree_Row::parent, root, and Etk_Tree_Row::tree.

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

References Etk_Tree_Row::first_child.

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

References Etk_Tree_Row::last_child.

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()

References Etk_Tree_Row::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()

References Etk_Tree_Row::next.

Referenced by etk_filechooser_widget_selected_files_get().

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)

References Etk_Tree_Row::last_child, Etk_Tree_Row::parent, Etk_Tree_Row::prev, root, Etk_Tree_Row::tree, and Etk_Tree_Row::unfolded.

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)

References Etk_Tree_Row::first_child, Etk_Tree_Row::next, Etk_Tree_Row::parent, and Etk_Tree_Row::unfolded.

Referenced by etk_tree_col_sort_full(), etk_tree_row_get_at_xy(), etk_tree_row_scroll_to(), etk_tree_select_all(), and etk_tree_unselect_all().

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

References Etk_Tree_Row::tree.

Etk_Tree_Row * etk_tree_row_get_at_xy ( Etk_Tree *  tree,
int  x,
int  y 
)

Gets the row that is at the absolute position ( x, y ).

Parameters:
tree a tree
x the x component of the position, relative to the canvas' top-left corner
y the y component of the position, relative to the canvas' top-left corner
Returns:
Returns the row of the tree that is at the given position, or NULL if there is no row here

References ETK_INSIDE, etk_tree_first_row_get(), etk_tree_row_walk_next(), etk_widget_inner_geometry_get(), grid, rows_height, and scroll_y.

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

References ETK_SCROLLED_VIEW, and scrolled_view.

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

References etk_range_value_set(), ETK_SCROLLED_VIEW, etk_scrolled_view_vscrollbar_get(), etk_tree_first_row_get(), etk_tree_row_walk_next(), etk_widget_inner_geometry_get(), grid, rows_height, scroll_y, scrolled_view, and Etk_Tree_Row::tree.