\section{toolbar\+\_\+example\+\_\+02.\+c}

\begin{DoxyCodeInclude}

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

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_item\_pressed(\textcolor{keywordtype}{void} *data, Evas\_Object *obj, \textcolor{keywordtype}{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 \textcolor{keywordtype}{int}
elm\_main(\textcolor{keywordtype}{int} argc, \textcolor{keywordtype}{char} **argv)
\{
   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(\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);
   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, \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);

   tb\_it = elm\_toolbar\_item\_append(tb, \textcolor{stringliteral}{"mail-send"}, \textcolor{stringliteral}{"Send Mail"},
                                   \_item\_pressed, NULL);
   elm\_toolbar\_item\_state\_add(tb\_it, \textcolor{stringliteral}{"emptytrash"}, \textcolor{stringliteral}{"Empty Trash"},
                              \_item\_pressed, NULL);
   elm\_toolbar\_item\_state\_add(tb\_it, \textcolor{stringliteral}{"trashcan\_full"}, \textcolor{stringliteral}{"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();

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