Tizen Native API
6.0
|
toolbar_example_02.c
#include <Elementary.h> static void _item_pressed(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) { Elm_Object_Item *tb_it = event_info; elm_toolbar_item_state_set(tb_it, elm_toolbar_item_state_next(tb_it)); elm_toolbar_item_selected_set(tb_it, EINA_FALSE); } EAPI_MAIN int elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) { Evas_Object *win, *bx, *tb, *bt; Elm_Object_Item *tb_it; elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); win = elm_win_util_standard_add("toolbar", "Toolbar Example"); elm_win_autodel_set(win, EINA_TRUE); bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, bx); evas_object_show(bx); bt = elm_button_add(win); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_object_text_set(bt, "Button"); evas_object_show(bt); tb = elm_toolbar_add(win); elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_HIDE); evas_object_size_hint_weight_set(tb, 0.0, 0.0); evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0); evas_object_show(tb); elm_toolbar_item_append(tb, "document-print", "Print", NULL, NULL); elm_toolbar_item_append(tb, "folder-new", "Folder", NULL, NULL); elm_toolbar_item_append(tb, "clock", "Clock", NULL, NULL); elm_toolbar_item_append(tb, "refresh", "Update", NULL, NULL); tb_it = elm_toolbar_item_append(tb, "mail-send", "Send Mail", _item_pressed, NULL); elm_toolbar_item_state_add(tb_it, "emptytrash", "Empty Trash", _item_pressed, NULL); elm_toolbar_item_state_add(tb_it, "trashcan_full", "Full Trash", _item_pressed, NULL); elm_toolbar_item_priority_set(tb_it, 10); elm_box_pack_end(bx, tb); elm_box_pack_end(bx, bt); evas_object_resize(win, 230, 200); evas_object_show(win); elm_run(); return 0; } ELM_MAIN()