1 #include <Elementary.h>
4 #include "elw_button.h"
6 #include "elw_boxedbutton.h"
10 _btn_clicked_cb(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info)
14 const Eo_Class *klass = eo_class_get(obj);
15 printf("%s obj-type:'%s' data:'%s'\n", desc->name, eo_class_name_get(klass), (const char *) data);
17 return EO_CALLBACK_CONTINUE;
21 main(int argc, char *argv[])
23 Evas_Coord winw, winh;
32 Eo *win = eo_add(ELW_WIN_CLASS, NULL);
33 eo_do(win, evas_obj_size_set(winw, winh), evas_obj_visibility_set(EINA_TRUE));
35 Eo *bt = eo_add(ELW_BUTTON_CLASS, win);
36 eo_do(bt, evas_obj_position_set(25, 25),
37 evas_obj_size_set(50, 50),
38 evas_obj_color_set(255, 0, 0, 255),
39 elw_button_text_set("Click"),
40 evas_obj_visibility_set(EINA_TRUE));
41 eo_do(bt, eo_event_callback_add(EV_CLICKED, _btn_clicked_cb, "btn"));
44 eo_do(bt, evas_obj_color_get(&r, &g, &b, &a));
45 printf("RGBa(%d, %d, %d, %d)\n", r, g, b, a);
47 Eo *bx = eo_add(ELW_BOXEDBUTTON_CLASS, win);
48 eo_do(bx, evas_obj_position_set(100, 100),
49 evas_obj_size_set(70, 70),
50 evas_obj_color_set(0, 0, 255, 255),
51 elw_button_text_set("Click2"),
52 evas_obj_visibility_set(EINA_TRUE));
53 eo_do(bx, eo_event_callback_add(EV_CLICKED, _btn_clicked_cb, "bxedbtn"));