Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/bin Modified Files: ewl_freebox_test.c Log Message: - add some todo/bugs for the freebox - the Ewl_Icon widget will now send a VALUE_CHANGED callback when the label is changed - Hook up the comparator test to allow changing of labels on the icons =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/bin/ewl_freebox_test.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ewl_freebox_test.c 31 Dec 2005 07:37:12 -0000 1.2 +++ ewl_freebox_test.c 31 Dec 2005 17:56:09 -0000 1.3 @@ -1,6 +1,18 @@ #include "ewl_test.h" +#include <stdlib.h> static Ewl_Widget *fb_button; +static Ewl_Widget *sort_fb; + +static void +ewl_freebox_cb_icon_change(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__, + void *data) +{ + Ewl_Freebox *fb; + + fb = data; + ewl_freebox_resort(EWL_FREEBOX(fb)); +} static int ewl_freebox_cb_compare(Ewl_Widget *a, Ewl_Widget *b) @@ -39,10 +51,26 @@ for (t = 0; files[t].name != NULL; t++) { + long width, height; + + width = (rand() % 30) + 30; + height = (rand() % 30) + 30; + i = ewl_icon_new(); ewl_container_child_append(EWL_CONTAINER(fb), i); ewl_icon_label_set(EWL_ICON(i), files[t].name); ewl_icon_image_set(EWL_ICON(i), files[t].path, NULL); + ewl_object_fill_policy_set(EWL_OBJECT(i), + EWL_FLAG_FILL_FILL); + ewl_object_minimum_size_set(EWL_OBJECT(i), (int)width, + (int)height); + + if (fb == sort_fb) + { + ewl_icon_editable_set(EWL_ICON(i), TRUE); + ewl_callback_append(i, EWL_CALLBACK_VALUE_CHANGED, + ewl_freebox_cb_icon_change, fb); + } ewl_widget_show(i); } } @@ -63,6 +91,8 @@ fb_button = w; + srand(time(NULL)); + win = ewl_window_new(); ewl_window_title_set(EWL_WINDOW(win), "Freebox Test"); ewl_window_name_set(EWL_WINDOW(win), "EWL Test Application"); @@ -170,6 +200,7 @@ ewl_freebox_cb_compare); ewl_container_child_append(EWL_CONTAINER(pane), fb); ewl_widget_show(fb); + sort_fb = fb; o = ewl_button_new(); ewl_button_label_set(EWL_BUTTON(o), "Add items"); ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs