2 * Simple Elementary's <b>toolbar widget</b> example, illustrating its
5 * See stdout/stderr for output. Compile with:
8 * gcc -g toolbar_example_02.c -o toolbar_example_02 `pkg-config --cflags --libs elementary`
12 #include <Elementary.h>
23 _item_pressed(void *data, Evas_Object *obj, void *event_info)
25 Elm_Object_Item *tb_it = event_info;
26 elm_toolbar_item_state_set(tb_it, elm_toolbar_item_state_next(tb_it));
27 elm_toolbar_item_selected_set(tb_it, EINA_FALSE);
31 elm_main(int argc, char **argv)
33 Evas_Object *win, *bg, *bx, *tb, *bt;
34 Elm_Object_Item *tb_it;
36 win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC);
37 elm_win_title_set(win, "Toolbar Example");
38 evas_object_smart_callback_add(win, "delete,request", _on_done, NULL);
41 elm_win_resize_object_add(win, bg);
42 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
45 bx = elm_box_add(win);
46 elm_win_resize_object_add(win, bx);
47 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
48 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
51 bt = elm_button_add(win);
52 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
53 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
54 elm_object_text_set(bt, "Button");
57 tb = elm_toolbar_add(win);
58 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_HIDE);
59 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
60 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
63 elm_toolbar_item_append(tb, "document-print", "Print", NULL, NULL);
64 elm_toolbar_item_append(tb, "folder-new", "Folder", NULL, NULL);
65 elm_toolbar_item_append(tb, "clock", "Clock", NULL, NULL);
66 elm_toolbar_item_append(tb, "refresh", "Update", NULL, NULL);
68 tb_it = elm_toolbar_item_append(tb, "mail-send", "Send Mail",
70 elm_toolbar_item_state_add(tb_it, "emptytrash", "Empty Trash",
72 elm_toolbar_item_state_add(tb_it, "trashcan_full", "Full Trash",
75 elm_toolbar_item_priority_set(tb_it, 10);
77 elm_box_pack_end(bx, tb);
78 elm_box_pack_end(bx, bt);
80 evas_object_resize(win, 230, 200);
81 evas_object_show(win);