Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/test


Modified Files:
        ewl_test.c ewl_tree_test.c 


Log Message:
I was putting off this commit until tree widget fixed, but I've been short on
time. This commit contains some minor refactoring and cleaning up of old code.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_test.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -3 -r1.45 -r1.46
--- ewl_test.c  13 Jul 2003 05:52:50 -0000      1.45
+++ ewl_test.c  22 Sep 2003 06:09:25 -0000      1.46
@@ -106,7 +106,6 @@
         * Create the button for the box test and add it to the box.
         */
        button[i] = ewl_button_new("Ewl_Box");
-       ewl_object_set_padding(EWL_OBJECT(button[i]), 0, 0, 10, 5);
        ewl_callback_append(button[i], EWL_CALLBACK_CLICKED,
                            __create_box_test_window, NULL);
        i++;
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_tree_test.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ewl_tree_test.c     26 May 2003 16:39:40 -0000      1.3
+++ ewl_tree_test.c     22 Sep 2003 06:09:25 -0000      1.4
@@ -1,6 +1,6 @@
 #include <Ewl.h>
 
-#define ROWS 100
+#define ROWS 10
 #define COLS 4
 #define NEST 3
 
@@ -29,9 +29,9 @@
                                void *user_data)
 {
        int row, col;
+       char *entries[COLS];
        Ewl_Widget *tree_win;
        Ewl_Widget *tree;
-       Ewl_Widget *entries[COLS];
        Ewl_Widget *prow = NULL;
 
        ewl_callback_del(w, EWL_CALLBACK_CLICKED,
@@ -40,7 +40,7 @@
        tree_button = w;
 
        tree_win = ewl_window_new();
-       ewl_object_set_maximum_size(EWL_OBJECT(tree_win), 200, 200);
+       ewl_object_set_minimum_size(EWL_OBJECT(tree_win), 400, 400);
        ewl_callback_append(tree_win, EWL_CALLBACK_DELETE_WINDOW,
                            __destroy_tree_test_window, NULL);
        ewl_widget_show(tree_win);
@@ -49,6 +49,8 @@
        ewl_container_append_child(EWL_CONTAINER(tree_win), tree);
        ewl_widget_show(tree);
 
+       memset(entries, 0, COLS * sizeof(char *));
+
        for (row = 0; row < ROWS; row++) {
                char buf[1024];
 
@@ -57,17 +59,21 @@
                 */
                for (col = 0; col < COLS; col++) {
                        snprintf(buf, 1024, "Row %d Col %d", row, col);
-                       entries[col] = ewl_entry_new(buf);
-                       ewl_widget_show(entries[col]);
+                       IF_FREE(entries[col]);
+                       entries[col] = strdup(buf);
                }
 
                if (row % NEST == 0)
-                       prow = ewl_tree_add_row(EWL_TREE(tree), NULL, entries);
-               else
-                       prow = ewl_tree_add_row(EWL_TREE(tree), EWL_ROW(prow),
+                       prow = ewl_tree_add_text_row(EWL_TREE(tree), NULL,
                                        entries);
+               else
+                       prow = ewl_tree_add_text_row(EWL_TREE(tree),
+                                       EWL_ROW(prow), entries);
                /* ewl_tree_set_row_expanded(EWL_ROW(prow), TRUE); */
        }
+
+       for (col = 0; col < COLS; col++)
+               IF_FREE(entries[col]);
 
        printf("Tree setup complete!!!\n");
 




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to