2 * gcc -o button_example_00 button_example_00.c `pkg-config --cflags --libs elementary`
4 #include <Elementary.h>
7 on_click(void *data, Evas_Object *obj, void *event_info)
13 elm_main(int argc, char **argv)
15 Evas_Object *win = NULL;
16 Evas_Object *bg = NULL;
17 Evas_Object *btn = NULL;
19 /* Create an win, associate it with a canvas and */
20 /* turn it visible on WM (Window Manager). */
21 win = elm_win_add(NULL, "Greetings", ELM_WIN_BASIC);
22 elm_win_title_set(win, "Hello, World!");
23 elm_win_autodel_set(win, EINA_TRUE);
24 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
25 evas_object_resize(win, 240, 60);
26 evas_object_show(win);
28 /* Create a bg, associate it to an win */
29 /* and turn it visible on WM. */
31 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
32 elm_win_resize_object_add(win, bg);
35 /* Create a btn, associate to a function, associate */
36 /* to win, give a dimension and position. */
37 btn = elm_button_add(win);
38 elm_object_text_set(btn, "Good-Bye, World!");
39 evas_object_smart_callback_add(btn, "clicked", on_click, NULL);
40 evas_object_resize(btn, 120, 30);
41 evas_object_move(btn, 60, 15);
42 evas_object_show(btn);