Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/bin Modified Files: ewl_calendar_test.c ewl_datepicker_test.c ewl_iconbox_test.c Log Message: Modified iconbox/calendar/datepicker tests to work properly. Moved printf -> DWARNING for same C99 correctness fixes (no decs inside code body) Fix for datepicker to kill calendar window on main widget destroy =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/bin/ewl_calendar_test.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_calendar_test.c 10 Jul 2005 08:18:05 -0000 1.1 +++ ewl_calendar_test.c 11 Jul 2005 01:33:59 -0000 1.2 @@ -1,7 +1,7 @@ #include "ewl_test.h" Ewl_Widget* cal; -Ewl_Widget* win; +Ewl_Widget* calendar_win; Ewl_Widget *calendar_button; void @@ -30,20 +30,20 @@ { calendar_button = w; - win= ewl_window_new(); + calendar_win= ewl_window_new(); - ewl_window_title_set(EWL_WINDOW(win), "Calendar"); - ewl_window_name_set(EWL_WINDOW(win), "Calendar"); - ewl_window_class_set(EWL_WINDOW(win), "Calendar"); - ewl_object_size_request(EWL_OBJECT(win), 159,160); + ewl_window_title_set(EWL_WINDOW(calendar_win), "Calendar"); + ewl_window_name_set(EWL_WINDOW(calendar_win), "Calendar"); + ewl_window_class_set(EWL_WINDOW(calendar_win), "Calendar"); + ewl_object_size_request(EWL_OBJECT(calendar_win), 159,160); if (w) { ewl_callback_del(w, EWL_CALLBACK_CLICKED, __create_calendar_test_window); - ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW, + ewl_callback_append(calendar_win, EWL_CALLBACK_DELETE_WINDOW, __destroy_calendar_test_window, NULL); } else - ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW, + ewl_callback_append(calendar_win, EWL_CALLBACK_DELETE_WINDOW, __close_main_window, NULL); @@ -51,14 +51,12 @@ cal = ewl_calendar_new(); - ewl_object_fill_policy_set(EWL_OBJECT(win), EWL_FLAG_FILL_ALL); - ewl_container_child_append(EWL_CONTAINER(win), cal); + ewl_object_fill_policy_set(EWL_OBJECT(calendar_win), EWL_FLAG_FILL_ALL); + ewl_container_child_append(EWL_CONTAINER(calendar_win), cal); - ewl_widget_show(win); + ewl_widget_show(calendar_win); ewl_widget_show(cal); - ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW, - __destroy_calendar_test_window, NULL); ewl_callback_append(EWL_WIDGET(cal), EWL_CALLBACK_VALUE_CHANGED,ewl_calendar_test, cal); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/bin/ewl_datepicker_test.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_datepicker_test.c 10 Jul 2005 09:09:32 -0000 1.1 +++ ewl_datepicker_test.c 11 Jul 2005 01:33:59 -0000 1.2 @@ -1,21 +1,40 @@ #include "ewl_test.h" -Ewl_Widget* datepicker; -Ewl_Widget* datepicker_win; +static Ewl_Widget* datepicker_button = NULL; -void - __destroy_datepicker_window(Ewl_Widget *main_win, void *ev_data, void *user_data) + +static void + __destroy_datepicker_window(Ewl_Widget *main_win , void *ev_data __UNUSED__, void *user_data __UNUSED__) { - ewl_widget_destroy(datepicker_win); + ewl_widget_destroy(main_win); + ewl_callback_append(datepicker_button, EWL_CALLBACK_CLICKED, + __create_datepicker_test_window, NULL); } void __create_datepicker_test_window(Ewl_Widget * w, void *ev_data __UNUSED__, void *user_data __UNUSED__) { - + Ewl_Widget* datepicker; + Ewl_Widget* datepicker_win; + + datepicker_button = w; datepicker_win= ewl_window_new(); + + if (w) { + ewl_callback_del(w, EWL_CALLBACK_CLICKED, + __create_datepicker_test_window); + ewl_callback_append(datepicker_win, EWL_CALLBACK_DELETE_WINDOW, + __destroy_datepicker_window, NULL); + } else { + ewl_callback_append(datepicker_win, EWL_CALLBACK_DELETE_WINDOW, + __close_main_window, NULL); + } + + + + ewl_window_title_set(EWL_WINDOW(datepicker_win), "DatePicker"); ewl_window_name_set(EWL_WINDOW(datepicker_win), "DatePicker"); @@ -32,9 +51,6 @@ ewl_widget_show(datepicker_win); ewl_widget_show(datepicker); - ewl_callback_append(datepicker_win, EWL_CALLBACK_DELETE_WINDOW, - __destroy_datepicker_window, NULL); - /*ewl_callback_append(EWL_WIDGET(cal), EWL_CALLBACK_VALUE_CHANGED,ewl_calendar_test, cal);*/ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/bin/ewl_iconbox_test.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_iconbox_test.c 10 Jul 2005 12:39:00 -0000 1.1 +++ ewl_iconbox_test.c 11 Jul 2005 01:33:59 -0000 1.2 @@ -2,6 +2,7 @@ #include <stdlib.h> Ewl_Widget* ib; +static Ewl_Widget* ewl_iconbox_button = NULL; void icon_click_cb(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__, void *user_data __UNUSED__) { printf("Icon clicked!\n"); @@ -22,9 +23,12 @@ } void - __destroy_main_window(Ewl_Widget *main_win, void *ev_data __UNUSED__, void *user_data __UNUSED__) + __destroy_iconbox_test_window(Ewl_Widget *main_win, void *ev_data __UNUSED__, void *user_data __UNUSED__) { ewl_widget_destroy(main_win); + ewl_callback_append(ewl_iconbox_button, EWL_CALLBACK_CLICKED, + __create_iconbox_test_window, NULL); + return; } @@ -36,8 +40,19 @@ Ewl_Widget* ib_win; + ewl_iconbox_button=w; ib_win= ewl_window_new(); + + if (w) { + ewl_callback_del(w, EWL_CALLBACK_CLICKED, + __create_iconbox_test_window); + ewl_callback_append(ib_win, EWL_CALLBACK_DELETE_WINDOW, + __destroy_iconbox_test_window, NULL); + } else + ewl_callback_append(ib_win, EWL_CALLBACK_DELETE_WINDOW, + __close_main_window, NULL); + ewl_window_title_set(EWL_WINDOW(ib_win), "Icon Box"); ewl_window_name_set(EWL_WINDOW(ib_win), "Icon Box"); @@ -69,8 +84,6 @@ ewl_widget_show(ib_win); ewl_widget_show(ib); - ewl_callback_append(ib_win, EWL_CALLBACK_DELETE_WINDOW, - __destroy_main_window, NULL); ewl_callback_append(button, EWL_CALLBACK_MOUSE_DOWN, add_icons_cb, NULL); ------------------------------------------------------- This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual core and dual graphics technology at this free one hour event hosted by HP, AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs