Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_calendar.c 


Log Message:
- simplify

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_calendar.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- ewl_calendar.c      11 Jul 2006 01:24:24 -0000      1.18
+++ ewl_calendar.c      11 Jul 2006 01:52:25 -0000      1.19
@@ -412,53 +412,21 @@
 ewl_calendar_add_day_labels(Ewl_Calendar *ib) 
 {
        Ewl_Widget* day_label;
+       char *days[] = {"M", "T", "W", "T", "F", "S", "S", NULL};
+       int i;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("ib", ib);
        DCHECK_TYPE("ib", ib, EWL_CALENDAR_TYPE);
 
-       /* Add the days*/
-       day_label = ewl_label_new();
-       ewl_label_text_set(EWL_LABEL(day_label), "M");
-       ewl_container_child_append(EWL_CONTAINER(ib->grid), day_label);
-       ewl_grid_child_position_set(EWL_GRID(ib->grid), day_label, 0, 0, 0, 0);
-       ewl_widget_show(day_label);
-
-       day_label = ewl_label_new();
-       ewl_label_text_set(EWL_LABEL(day_label), "T");
-       ewl_container_child_append(EWL_CONTAINER(ib->grid), day_label);
-       ewl_grid_child_position_set(EWL_GRID(ib->grid), day_label, 1, 1, 0, 0);
-       ewl_widget_show(day_label);
-
-       day_label = ewl_label_new();
-       ewl_label_text_set(EWL_LABEL(day_label), "W");
-       ewl_container_child_append(EWL_CONTAINER(ib->grid), day_label);
-       ewl_grid_child_position_set(EWL_GRID(ib->grid), day_label, 2, 2, 0, 0);
-       ewl_widget_show(day_label);
-
-       day_label = ewl_label_new();
-       ewl_label_text_set(EWL_LABEL(day_label), "T");
-       ewl_container_child_append(EWL_CONTAINER(ib->grid), day_label);
-       ewl_grid_child_position_set(EWL_GRID(ib->grid), day_label, 3, 3, 0, 0);
-       ewl_widget_show(day_label);
-
-       day_label = ewl_label_new();
-       ewl_label_text_set(EWL_LABEL(day_label), "F");
-       ewl_container_child_append(EWL_CONTAINER(ib->grid), day_label);
-       ewl_grid_child_position_set(EWL_GRID(ib->grid), day_label, 4, 4, 0, 0);
-       ewl_widget_show(day_label);
-
-       day_label = ewl_label_new();
-       ewl_label_text_set(EWL_LABEL(day_label), "S");
-       ewl_container_child_append(EWL_CONTAINER(ib->grid), day_label);
-       ewl_grid_child_position_set(EWL_GRID(ib->grid), day_label, 5, 5, 0, 0);
-       ewl_widget_show(day_label);
-
-       day_label = ewl_label_new();
-       ewl_label_text_set(EWL_LABEL(day_label), "S");
-       ewl_container_child_append(EWL_CONTAINER(ib->grid), day_label);
-       ewl_grid_child_position_set(EWL_GRID(ib->grid), day_label, 6, 6, 0, 0);
-       ewl_widget_show(day_label);
+       for (i = 0; days[i] != NULL; i++)
+       {
+               day_label = ewl_label_new();
+               ewl_label_text_set(EWL_LABEL(day_label), days[i]);
+               ewl_container_child_append(EWL_CONTAINER(ib->grid),
+                                                       day_label);
+               ewl_widget_show(day_label);
+       }
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }




-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to