Etk
Main Page Object Hierarchy Data Structures Related Pages
Etk

Etk_Tree_Model


Detailed Description

Etk_Tree_Models are used by a tree to define the content of its columns


Data Structures

struct  Etk_Tree_Model
 A tree model defines the content of a tree's column, and how it should be displayed. More...

Functions

Etk_Tree_Model * etk_tree_model_text_new (void)
 Creates a tree model that displays a text.
Etk_Tree_Model * etk_tree_model_int_new (void)
 Creates a tree model that displays an integer value.
Etk_Tree_Model * etk_tree_model_double_new (void)
 Creates a tree model that displays a float value.
Etk_Tree_Model * etk_tree_model_image_new (void)
 Creates a tree model that displays an image.
Etk_Tree_Model * etk_tree_model_checkbox_new (void)
 Creates a tree model that displays an checkbox. Clicking on the checkbox toggles its state.
Etk_Tree_Model * etk_tree_model_progress_bar_new (void)
 Creates a tree model that displays an checkbox. Clicking on the checkbox toggles its state.
void etk_tree_model_free (Etk_Tree_Model *model)
 Frees a tree model. Usually, you don't need to call it, it's called automatically when the tree is destroyed.
void etk_tree_model_cache_remove (Etk_Tree_Model *model, const char *filename, const char *key)
 Removes an object from the model's cache.
void etk_tree_model_image_width_set (Etk_Tree_Model *model, int width, float alignment)
 Sets the max width allocated to the image in the image model. If the image's width is smaller than the max width, the image will be aligned according to alignment.
void etk_tree_model_image_width_get (Etk_Tree_Model *model, int *width, float *alignment)
 Gets the max width allocated to the image in the image model, and its alignment.


Function Documentation

Etk_Tree_Model* etk_tree_model_text_new ( void   ) 

Creates a tree model that displays a text.

Returns:
Returns the new model
Note:
You don't need to free it with etk_tree_model_free() if is associtated to a column. It will be freed automatically when the column is destroyed

References cache_remove, cell_data_free, cell_data_get, cell_data_set, cell_data_size, objects_create, render, and width_get.

Etk_Tree_Model* etk_tree_model_int_new ( void   ) 

Creates a tree model that displays an integer value.

Returns:
Returns the new model
Note:
You don't need to free it with etk_tree_model_free() if is associtated to a column. It will be freed automatically when the column is destroyed

References cache_remove, cell_data_get, cell_data_set, cell_data_size, objects_create, render, and width_get.

Etk_Tree_Model* etk_tree_model_double_new ( void   ) 

Creates a tree model that displays a float value.

Returns:
Returns the new model
Note:
You don't need to free it with etk_tree_model_free() if is associtated to a column. It will be freed automatically when the column is destroyed

References cache_remove, cell_data_get, cell_data_set, cell_data_size, objects_create, render, and width_get.

Etk_Tree_Model* etk_tree_model_image_new ( void   ) 

Creates a tree model that displays an image.

Returns:
Returns the new model
Note:
You don't need to free it with etk_tree_model_free() if is associtated to a column. It will be freed automatically when the column is destroyed

References cache_remove, cell_data_free, cell_data_get, cell_data_set, cell_data_size, etk_cache_new(), model_free, objects_cache, render, and width_get.

Etk_Tree_Model* etk_tree_model_checkbox_new ( void   ) 

Creates a tree model that displays an checkbox. Clicking on the checkbox toggles its state.

Returns:
Returns the new model
Note:
You don't need to free it with etk_tree_model_free() if is associtated to a column. It will be freed automatically when the column is destroyed

References cache_remove, cell_data_get, cell_data_set, cell_data_size, objects_create, render, and width_get.

Etk_Tree_Model* etk_tree_model_progress_bar_new ( void   ) 

Creates a tree model that displays an checkbox. Clicking on the checkbox toggles its state.

Returns:
Returns the new model
Note:
You don't need to free it with etk_tree_model_free() if is associtated to a column. It will be freed automatically when the column is destroyed

References cache_remove, cell_data_free, cell_data_get, cell_data_set, cell_data_size, objects_create, render, and width_get.

void etk_tree_model_free ( Etk_Tree_Model *  model  ) 

Frees a tree model. Usually, you don't need to call it, it's called automatically when the tree is destroyed.

Parameters:
model the model to free

References model_free.

void etk_tree_model_cache_remove ( Etk_Tree_Model *  model,
const char *  filename,
const char *  key 
)

Removes an object from the model's cache.

Parameters:
model the model to remove from
filename the filename associated with the object
key the key associated with the object

References cache_remove.

void etk_tree_model_image_width_set ( Etk_Tree_Model *  model,
int  width,
float  alignment 
)

Sets the max width allocated to the image in the image model. If the image's width is smaller than the max width, the image will be aligned according to alignment.

Parameters:
model an image model
width the max width of the image of the model. 0 or a negative value to make Etk compute the width of each image
alignment the horizontal alignment of the image, used if its width is smaller than the max width, from 0.0 (left alignment) to 1.0 (right alignment)

References ETK_CLAMP, ETK_WIDGET, and etk_widget_redraw_queue().

void etk_tree_model_image_width_get ( Etk_Tree_Model *  model,
int *  width,
float *  alignment 
)

Gets the max width allocated to the image in the image model, and its alignment.

Parameters:
model an image model
width the location where to store the max width of the image of the model
alignment the location where to store the horizontal alignment of the image