summaryrefslogtreecommitdiff
path: root/src/examples/elementary/button_example_00.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-03-23 12:56:14 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-03-23 13:24:41 -0700
commitc2a1c49ab2042f559b28e840e54feb8494888e0e (patch)
treec6eb110b7c479499854eede9d0c3ab0a80c9a11a /src/examples/elementary/button_example_00.c
parent9340855597e7e465435c69b6278650346688da14 (diff)
elementary: move all legacy files to their expected new location.
Diffstat (limited to 'src/examples/elementary/button_example_00.c')
-rw-r--r--src/examples/elementary/button_example_00.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/examples/elementary/button_example_00.c b/src/examples/elementary/button_example_00.c
new file mode 100644
index 0000000000..633232a915
--- /dev/null
+++ b/src/examples/elementary/button_example_00.c
@@ -0,0 +1,41 @@
1/*
2 * gcc -o button_example_00 button_example_00.c `pkg-config --cflags --libs elementary`
3 */
4#include <Elementary.h>
5
6static void
7on_click(void *data, Evas_Object *obj, void *event_info)
8{
9 elm_exit();
10}
11
12EAPI_MAIN int
13elm_main(int argc, char **argv)
14{
15 Evas_Object *win = NULL;
16 Evas_Object *btn = NULL;
17
18 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
19
20 /* Create an win, associate it with a canvas and */
21 /* turn it visible on WM (Window Manager). */
22 win = elm_win_util_standard_add("Greetings", "Hello, World!");
23 elm_win_autodel_set(win, EINA_TRUE);
24
25 /* Create a btn, associate to a function, associate */
26 /* to win, give a dimension and position. */
27 btn = elm_button_add(win);
28 elm_object_text_set(btn, "Good-Bye, World!");
29 evas_object_smart_callback_add(btn, "clicked", on_click, NULL);
30 evas_object_resize(btn, 120, 30);
31 evas_object_move(btn, 60, 15);
32 evas_object_show(btn);
33
34 evas_object_resize(win, 240, 60);
35 evas_object_show(win);
36
37 elm_run();
38
39 return 0;
40}
41ELM_MAIN()