From: <enl...@li...> - 2004-01-27 06:13:44
|
Enlightenment CVS committal Author : rephorm Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src Modified Files: ewl_tree.c ewl_tree.h Log Message: Actually use text widgets on ewl_tree_text_row_add(); Added an ewl_tree_entry_row_add() to make a row of entries (how _text_row_add used to be) =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_tree.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -3 -r1.32 -r1.33 --- ewl_tree.c 14 Jan 2004 20:42:54 -0000 1.32 +++ ewl_tree.c 26 Jan 2004 02:46:48 -0000 1.33 @@ -214,6 +214,43 @@ Ewl_Widget *ewl_tree_add_text_row(Ewl_Tree *tree, Ewl_Row *prow, char **text) { int i; + Ewl_Widget **texts; + Ewl_Widget *row; + + DENTER_FUNCTION(DLEVEL_STABLE); + + DCHECK_PARAM_PTR_RET("tree", tree, NULL); + + texts = NEW(Ewl_Widget *, tree->ncols); + if (!texts) + DRETURN_PTR(NULL, DLEVEL_STABLE); + + for (i = 0; i < tree->ncols; i++) { + if (text) + texts[i] = ewl_text_new(text[i]); + else + texts[i] = ewl_text_new(NULL); + ewl_widget_show(texts[i]); + } + + row = ewl_tree_add_row(tree, prow, texts); + + FREE(texts); + + DRETURN_PTR(row, DLEVEL_STABLE); +} + +/** + * @param tree: the tree to hold the new entry row + * @param prow: the parent row of the new entry row + * @param text: the array of strings that hold the entry text to be added + * @brief Add a row of text entries to a tree + * + * @return Returns a pointer to a new row on success, NULL on failure. + */ +Ewl_Widget *ewl_tree_add_entry_row(Ewl_Tree *tree, Ewl_Row *prow, char **text) +{ + int i; Ewl_Widget **entries; Ewl_Widget *row; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_tree.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -3 -r1.17 -r1.18 --- ewl_tree.h 14 Jan 2004 20:42:54 -0000 1.17 +++ ewl_tree.h 26 Jan 2004 02:46:48 -0000 1.18 @@ -84,6 +84,7 @@ Ewl_Widget *ewl_tree_add_row(Ewl_Tree *tree, Ewl_Row *prow, Ewl_Widget **children); Ewl_Widget *ewl_tree_add_text_row(Ewl_Tree *tree, Ewl_Row *prow, char **text); +Ewl_Widget *ewl_tree_add_entry_row(Ewl_Tree *tree, Ewl_Row *prow, char **text); void ewl_tree_destroy_row(Ewl_Tree *tree, Ewl_Row *row); void ewl_tree_set_row_expand(Ewl_Row *row, Ewl_Tree_Node_Flags expanded); |