aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/elementary/src/examples/icon_example_01.c
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/elementary/src/examples/icon_example_01.c')
-rw-r--r--libraries/elementary/src/examples/icon_example_01.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/libraries/elementary/src/examples/icon_example_01.c b/libraries/elementary/src/examples/icon_example_01.c
new file mode 100644
index 0000000..daad19f
--- /dev/null
+++ b/libraries/elementary/src/examples/icon_example_01.c
@@ -0,0 +1,53 @@
1//Compile with:
2//gcc -g image_example_01.c -o image_example_01 `pkg-config --cflags --libs elementary`
3
4#include <Elementary.h>
5
6EAPI_MAIN int
7elm_main(int argc, char **argv)
8{
9 Evas_Object *win, *bg, *icon;
10 const char *path, *group, *name;
11
12 win = elm_win_add(NULL, "icon", ELM_WIN_BASIC);
13 elm_win_title_set(win, "Icon");
14 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
15 elm_win_autodel_set(win, EINA_TRUE);
16
17 bg = elm_bg_add(win);
18 elm_bg_color_set(bg, 255,255 ,255);
19 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
20 elm_win_resize_object_add(win, bg);
21 evas_object_show(bg);
22
23 icon = elm_icon_add(win);
24 elm_icon_order_lookup_set(icon, ELM_ICON_LOOKUP_THEME_FDO);
25 elm_icon_standard_set(icon, "home");
26
27 path = NULL;
28 group = NULL;
29 name = NULL;
30 elm_icon_file_get(icon, &path, &group);
31 name = elm_icon_standard_get(icon);
32 printf("path = %s, group = %s, name = %s\n", path, group, name);
33
34 elm_icon_no_scale_set(icon, EINA_TRUE);
35 elm_icon_resizable_set(icon, EINA_FALSE, EINA_TRUE);
36 elm_icon_smooth_set(icon, EINA_FALSE);
37 elm_icon_fill_outside_set(icon, EINA_TRUE);
38
39 evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
40 elm_win_resize_object_add(win, icon);
41 evas_object_show(icon);
42
43 evas_object_size_hint_min_set(bg, 160, 160);
44 evas_object_size_hint_max_set(bg, 640, 640);
45 evas_object_resize(win, 320, 320);
46 evas_object_show(win);
47
48 elm_run();
49 elm_shutdown();
50
51 return 0;
52}
53ELM_MAIN()