\section{toolbar\-\_\-example\-\_\-03.\-c}

\begin{DoxyCodeInclude}

\textcolor{preprocessor}{#include <Elementary.h>}

EAPI\_MAIN \textcolor{keywordtype}{int}
elm\_main(\textcolor{keywordtype}{int} argc, \textcolor{keywordtype}{char} **argv)
\{
   Evas\_Object *win, *bx, *tb, *bt, *menu;
   Elm_Object_Item *tb\_it;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_util_standard_add(\textcolor{stringliteral}{"toolbar"}, \textcolor{stringliteral}{"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, \textcolor{stringliteral}{"Button"});
   evas\_object\_show(bt);

   tb = elm_toolbar_add(win);
   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, \textcolor{stringliteral}{"document-print"}, \textcolor{stringliteral}{"Print"}, NULL, NULL);
   elm_toolbar_item_append(tb, \textcolor{stringliteral}{"folder-new"}, \textcolor{stringliteral}{"Folder"}, NULL, NULL);
   elm_toolbar_item_append(tb, \textcolor{stringliteral}{"clock"}, \textcolor{stringliteral}{"Clock"}, NULL, NULL);
   elm_toolbar_item_append(tb, \textcolor{stringliteral}{"refresh"}, \textcolor{stringliteral}{"Update"}, NULL, NULL);

   elm_toolbar_menu_parent_set(tb, win);

   tb\_it = elm_toolbar_item_append(tb, \textcolor{stringliteral}{"mail-send"}, \textcolor{stringliteral}{"Send Mail"}, NULL, NULL);
   elm_toolbar_item_menu_set(tb\_it, EINA\_TRUE);

   menu = elm_toolbar_item_menu_get(tb\_it);
   elm_menu_item_add(menu, NULL, \textcolor{stringliteral}{"emptytrash"}, \textcolor{stringliteral}{"Empty Trash"}, NULL, NULL);
   elm_menu_item_add(menu, NULL, \textcolor{stringliteral}{"trashcan\_full"}, \textcolor{stringliteral}{"Full Trash"}, NULL, 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();
   elm_shutdown();

   \textcolor{keywordflow}{return} 0;
\}
ELM_MAIN()
\end{DoxyCodeInclude}
 