cxx: Added examples and tutorial for C++ binding
[platform/upstream/elementary.git] / src / examples / popup_cxx_example_01.cc
1 #include <Elementary.hh>
2
3 EAPI_MAIN int
4 elm_main(int argc, char **argv)
5 {
6    elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
7
8    ::elm::win_standard win;
9    win.title_set("Popup");
10    win.autohide_set(true);
11
12    ::elm::popup popup(efl::eo::parent = win);
13    popup.timeout_set(3.0);
14    popup.text_set(nullptr, "Title");
15    popup.visible_set(true);
16
17    auto popup_hide = std::bind ( [&] ()
18                      {
19                         popup.visible_set(false);
20                      });
21
22    popup.callback_timeout_add(popup_hide);
23    popup.callback_block_clicked_add(popup_hide);
24    win.size_set(480, 800);
25    win.visible_set(true);
26
27    elm_run();
28    return 0;
29 }
30 ELM_MAIN()
31
32