Enlightenment CVS committal Author : rhapsodhy Project : e17 Module : proto
Dir : e17/proto/entrance_edit_gui/src/widgets Modified Files: ew_messagebox.c ew_messagebox.h ew_notice.c ew_notice.h Log Message: Instead of using response events, attach the clicked events to the buttons. This is easier, and you don't have to pay attention to so much things.:D =================================================================== RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/widgets/ew_messagebox.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- ew_messagebox.c 15 Aug 2006 13:52:07 -0000 1.4 +++ ew_messagebox.c 15 Aug 2006 14:46:35 -0000 1.5 @@ -4,7 +4,7 @@ #include <stdlib.h> #include "config.h" -static void _ew_messagebox_cb_ok(void *, int, void *); +static void _ew_messagebox_cb_ok(void *, void *); Entrance_Dialog _ew_messagebox_new(const char *title, const char *message, const char *icon) @@ -52,36 +52,35 @@ } Entrance_Dialog -ew_messagebox_ok_cancel(const char *title, const char *message, const char *icon, void (*funct)(void *, int, void *)) { +ew_messagebox_ok_cancel(const char *title, const char *message, const char *icon, void (*funct)(void *, void *)) { Entrance_Dialog ew = _ew_messagebox_new(title, message, icon); ew_notice_ok_button_add(ew, funct, NULL); - ew_notice_cancel_button_add(ew, NULL, NULL); + ew_notice_cancel_button_add(ew, funct, NULL); return ew; } Entrance_Dialog -ew_messagebox_yes_no(const char *title, const char *message, const char *icon, void (*funct)(void *, int, void *)) { +ew_messagebox_yes_no(const char *title, const char *message, const char *icon, void (*funct)(void *, void *)) { Entrance_Dialog ew = _ew_messagebox_new(title, message, icon); ew_notice_yes_button_add(ew, funct, NULL); - ew_notice_no_button_add(ew, NULL, NULL); + ew_notice_no_button_add(ew, funct, NULL); return ew; } Entrance_Dialog -ew_messagebox_yes_no_cancel(const char *title, const char *message, const char *icon, void (*funct)(void *, int, void *)) { +ew_messagebox_yes_no_cancel(const char *title, const char *message, const char *icon, void (*funct)(void *, void *)) { Entrance_Dialog ew = _ew_messagebox_new(title, message, icon); ew_notice_yes_button_add(ew, funct, NULL); - ew_notice_no_button_add(ew, NULL, NULL); - ew_notice_cancel_button_add(ew, NULL, NULL); + ew_notice_no_button_add(ew, funct, NULL); + ew_notice_cancel_button_add(ew, funct, NULL); return ew; } static void -_ew_messagebox_cb_ok(void *win, int response, void *data) { +_ew_messagebox_cb_ok(void *win, void *data) { Entrance_Dialog ew = data; - if(response == EW_NOTICE_OK_BUTTON) - ew_dialog_destroy(ew); + ew_dialog_destroy(ew); } =================================================================== RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/widgets/ew_messagebox.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- ew_messagebox.h 15 Aug 2006 13:52:07 -0000 1.3 +++ ew_messagebox.h 15 Aug 2006 14:46:35 -0000 1.4 @@ -8,9 +8,9 @@ #define EW_MESSAGEBOX_ICON_ERROR "error" Entrance_Dialog ew_messagebox_ok(const char *type, const char *title, const char *message); -Entrance_Dialog ew_messagebox_ok_cancel(const char *, const char *, const char *, void (*)(void *, int, void *)); -Entrance_Dialog ew_messagebox_yes_no(const char *, const char *, const char *, void (*)(void *, int, void *)); -Entrance_Dialog ew_messagebox_yes_no_cancel(const char *, const char *, const char *, void (*)(void *, int, void *)); +Entrance_Dialog ew_messagebox_ok_cancel(const char *, const char *, const char *, void (*)(void *, void *)); +Entrance_Dialog ew_messagebox_yes_no(const char *, const char *, const char *, void (*)(void *, void *)); +Entrance_Dialog ew_messagebox_yes_no_cancel(const char *, const char *, const char *, void (*)(void *, void *)); #endif =================================================================== RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/widgets/ew_notice.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- ew_notice.c 15 Aug 2006 14:29:08 -0000 1.3 +++ ew_notice.c 15 Aug 2006 14:46:35 -0000 1.4 @@ -38,43 +38,43 @@ } void -ew_notice_button_add(Entrance_Dialog ew, const char *name, int response_id, void (*response_event)(void *, int, void *), void *data) +ew_notice_button_add(Entrance_Dialog ew, const char *name, int response_id, void (*response_event)(void *, void *), void *data) { - etk_dialog_button_add(ETK_DIALOG(ew->owner), name, response_id); + Etk_Widget *btn = etk_dialog_button_add(ETK_DIALOG(ew->owner), name, response_id); if(response_event) - etk_signal_connect("response", ETK_OBJECT(ew->owner), ETK_CALLBACK(response_event), data); + etk_signal_connect("clicked", ETK_OBJECT(btn), ETK_CALLBACK(response_event), data); } void -ew_notice_close_button_add(Entrance_Dialog ew, void (*response_event)(void *, int, void *), void *data) +ew_notice_close_button_add(Entrance_Dialog ew, void (*response_event)(void *, void *), void *data) { ew_notice_button_add(ew, _("Close"), EW_NOTICE_CLOSE_BUTTON, response_event, data); } void -ew_notice_apply_button_add(Entrance_Dialog ew, void (*response_event)(void *, int, void *), void *data) +ew_notice_apply_button_add(Entrance_Dialog ew, void (*response_event)(void *, void *), void *data) { ew_notice_button_add(ew, _("Apply"), EW_NOTICE_APPLY_BUTTON, response_event, data); } void -ew_notice_ok_button_add(Entrance_Dialog ew, void (*response_event)(void *, int, void *), void *data) +ew_notice_ok_button_add(Entrance_Dialog ew, void (*response_event)(void *, void *), void *data) { ew_notice_button_add(ew, _("Ok"), EW_NOTICE_OK_BUTTON, response_event, data); } void -ew_notice_yes_button_add(Entrance_Dialog ew, void (*response_event)(void *, int, void *), void *data) { +ew_notice_yes_button_add(Entrance_Dialog ew, void (*response_event)(void *, void *), void *data) { ew_notice_button_add(ew, _("Yes"), EW_NOTICE_YES_BUTTON, response_event, data); } void -ew_notice_no_button_add(Entrance_Dialog ew, void (*response_event)(void *, int, void *), void *data) { +ew_notice_no_button_add(Entrance_Dialog ew, void (*response_event)(void *, void *), void *data) { ew_notice_button_add(ew, _("No"), EW_NOTICE_NO_BUTTON, response_event, data); } void -ew_notice_cancel_button_add(Entrance_Dialog ew, void (*response_event)(void *, int, void *), void *data) { +ew_notice_cancel_button_add(Entrance_Dialog ew, void (*response_event)(void *, void *), void *data) { ew_notice_button_add(ew, _("Cancel"), EW_NOTICE_CANCEL_BUTTON, response_event, data); } =================================================================== RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/widgets/ew_notice.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ew_notice.h 14 Aug 2006 17:08:55 -0000 1.2 +++ ew_notice.h 15 Aug 2006 14:46:35 -0000 1.3 @@ -14,12 +14,12 @@ Entrance_Widget ew_notice_group_add(Entrance_Dialog, const char *, int); void ew_notice_destroy(Entrance_Dialog); -void ew_notice_button_add(Entrance_Dialog, const char*, int, void (*)(void *, int, void *), void *); -void ew_notice_close_button_add(Entrance_Dialog, void (*)(void *, int, void *), void *); -void ew_notice_apply_button_add(Entrance_Dialog, void (*)(void *, int, void *), void *); -void ew_notice_ok_button_add(Entrance_Dialog, void (*)(void *, int, void *), void *); -void ew_notice_yes_button_add(Entrance_Dialog, void (*)(void *, int, void *), void *); -void ew_notice_no_button_add(Entrance_Dialog, void (*)(void *, int, void *), void *); -void ew_notice_cancel_button_add(Entrance_Dialog, void (*)(void *, int, void *), void *); +void ew_notice_button_add(Entrance_Dialog, const char*, int, void (*)(void *, void *), void *); +void ew_notice_close_button_add(Entrance_Dialog, void (*)(void *, void *), void *); +void ew_notice_apply_button_add(Entrance_Dialog, void (*)(void *, void *), void *); +void ew_notice_ok_button_add(Entrance_Dialog, void (*)(void *, void *), void *); +void ew_notice_yes_button_add(Entrance_Dialog, void (*)(void *, void *), void *); +void ew_notice_no_button_add(Entrance_Dialog, void (*)(void *, void *), void *); +void ew_notice_cancel_button_add(Entrance_Dialog, void (*)(void *, void *), void *); #endif ------------------------------------------------------------------------- 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