aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/elementary/src/examples/toolbar_example_03.c
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-04-22 09:20:32 +1000
committerDavid Walter Seikel2012-04-22 09:20:32 +1000
commit3ad3455551be0d7859ecb02290376206d5e66498 (patch)
tree497917e12b4d7f458dff9765d9b53f64c4e03fc3 /libraries/elementary/src/examples/toolbar_example_03.c
parentUpdate EFL to latest beta. (diff)
downloadSledjHamr-3ad3455551be0d7859ecb02290376206d5e66498.zip
SledjHamr-3ad3455551be0d7859ecb02290376206d5e66498.tar.gz
SledjHamr-3ad3455551be0d7859ecb02290376206d5e66498.tar.bz2
SledjHamr-3ad3455551be0d7859ecb02290376206d5e66498.tar.xz
And actually include new files, plus elementary libraries.
Diffstat (limited to 'libraries/elementary/src/examples/toolbar_example_03.c')
-rw-r--r--libraries/elementary/src/examples/toolbar_example_03.c81
1 files changed, 81 insertions, 0 deletions
diff --git a/libraries/elementary/src/examples/toolbar_example_03.c b/libraries/elementary/src/examples/toolbar_example_03.c
new file mode 100644
index 0000000..8af248b
--- /dev/null
+++ b/libraries/elementary/src/examples/toolbar_example_03.c
@@ -0,0 +1,81 @@
1/**
2 * Simple Elementary's <b>toolbar widget</b> example, illustrating its
3 * usage and API.
4 *
5 * See stdout/stderr for output. Compile with:
6 *
7 * @verbatim
8 * gcc -g toolbar_example_03.c -o toolbar_example_03 `pkg-config --cflags --libs elementary`
9 * @endverbatim
10 */
11
12#include <Elementary.h>
13
14static void
15_on_done(void *data,
16 Evas_Object *obj,
17 void *event_info)
18{
19 elm_exit();
20}
21
22EAPI_MAIN int
23elm_main(int argc, char **argv)
24{
25 Evas_Object *win, *bg, *bx, *tb, *bt, *menu;
26 Elm_Object_Item *tb_it;
27
28 win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC);
29 elm_win_title_set(win, "Toolbar Example");
30 evas_object_smart_callback_add(win, "delete,request", _on_done, NULL);
31
32 bg = elm_bg_add(win);
33 elm_win_resize_object_add(win, bg);
34 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
35 evas_object_show(bg);
36
37 bx = elm_box_add(win);
38 elm_win_resize_object_add(win, bx);
39 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
40 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
41 evas_object_show(bx);
42
43 bt = elm_button_add(win);
44 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
45 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
46 elm_object_text_set(bt, "Button");
47 evas_object_show(bt);
48
49 tb = elm_toolbar_add(win);
50 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
51 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
52 evas_object_show(tb);
53
54 elm_toolbar_item_append(tb, "document-print", "Print", NULL, NULL);
55 elm_toolbar_item_append(tb, "folder-new", "Folder", NULL, NULL);
56 elm_toolbar_item_append(tb, "clock", "Clock", NULL, NULL);
57 elm_toolbar_item_append(tb, "refresh", "Update", NULL, NULL);
58
59 elm_toolbar_menu_parent_set(tb, win);
60
61 tb_it = elm_toolbar_item_append(tb, "mail-send", "Send Mail", NULL, NULL);
62 elm_toolbar_item_menu_set(tb_it, EINA_TRUE);
63
64 menu = elm_toolbar_item_menu_get(tb_it);
65 elm_menu_item_add(menu, NULL, "emptytrash", "Empty Trash", NULL, NULL);
66 elm_menu_item_add(menu, NULL, "trashcan_full", "Full Trash", NULL, NULL);
67
68 elm_toolbar_item_priority_set(tb_it, 10);
69
70 elm_box_pack_end(bx, tb);
71 elm_box_pack_end(bx, bt);
72
73 evas_object_resize(win, 230, 200);
74 evas_object_show(win);
75
76 elm_run();
77 elm_shutdown();
78
79 return 0;
80}
81ELM_MAIN()