2 * Simple Elementary's <b>toolbar widget</b> example, illustrating its
5 * See stdout/stderr for output. Compile with:
8 * gcc -g `pkg-config --cflags --libs elementary` toolbar_example_02.c -o toolbar_example_02
12 #include <Elementary.h>
14 # include "elementary_config.h"
20 _on_done(void *data __UNUSED__,
21 Evas_Object *obj __UNUSED__,
22 void *event_info __UNUSED__)
28 _item_pressed(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
30 Elm_Object_Item *tb_it = event_info;
31 elm_toolbar_item_state_set(tb_it, elm_toolbar_item_state_next(tb_it));
32 elm_toolbar_item_selected_set(tb_it, EINA_FALSE);
36 elm_main(int argc __UNUSED__, char **argv __UNUSED__)
38 Evas_Object *win, *bg, *bx, *tb, *bt;
39 Elm_Object_Item *tb_it;
41 win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC);
42 elm_win_title_set(win, "Toolbar Example");
43 evas_object_smart_callback_add(win, "delete,request", _on_done, NULL);
46 elm_win_resize_object_add(win, bg);
47 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
50 bx = elm_box_add(win);
51 elm_win_resize_object_add(win, bx);
52 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
53 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
56 bt = elm_button_add(win);
57 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
58 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
59 elm_object_text_set(bt, "Button");
62 tb = elm_toolbar_add(win);
63 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_HIDE);
64 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
65 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
68 elm_toolbar_item_append(tb, "document-print", "Print", NULL, NULL);
69 elm_toolbar_item_append(tb, "folder-new", "Folder", NULL, NULL);
70 elm_toolbar_item_append(tb, "clock", "Clock", NULL, NULL);
71 elm_toolbar_item_append(tb, "refresh", "Update", NULL, NULL);
73 tb_it = elm_toolbar_item_append(tb, "mail-send", "Send Mail",
75 elm_toolbar_item_state_add(tb_it, "emptytrash", "Empty Trash",
77 elm_toolbar_item_state_add(tb_it, "trashcan_full", "Full Trash",
80 elm_toolbar_item_priority_set(tb_it, 10);
82 elm_box_pack_end(bx, tb);
83 elm_box_pack_end(bx, bt);
85 evas_object_resize(win, 230, 200);
86 evas_object_show(win);