summaryrefslogtreecommitdiff
path: root/src/examples/elementary/button_cxx_example_00.cc
blob: 9239f74734fe93539a23d299f478c32d030f0c5e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "elementary_config.h"
#endif

#include <Elementary.hh>

EAPI_MAIN int
elm_main (int argc, char *argv[])
{
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);

   efl::ui::win::Standard win;
//    //win.title_set("Hello, World!");
//    win.autohide_set(true);

//    ::elm::Button btn(win);
//    btn.text_set("elm.text","Good-Bye, World!");
//    btn.eo_cxx::efl::Gfx::size_set(120, 30);
//    btn.eo_cxx::efl::Gfx::position_set(60, 15);
//    // btn.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
//    // btn.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL);
   // win.title_set("Hello, World!");
   win.autohide_set(true);

   ::elm::Button btn(win);
   btn.eo_cxx::elm::Layout::text_set(nullptr,"Good-Bye, World!");
   btn.eo_cxx::efl::Gfx::size_set(120, 30);
   btn.eo_cxx::efl::Gfx::position_set(60, 15);
   btn.visible_set(true);

   auto on_click = std::bind([] () { elm_exit(); });

   efl::eolian::event_add(efl::ui::Clickable::clicked_event, btn, on_click);

   win.eo_cxx::efl::Gfx::size_set(240, 60);
   win.visible_set(true);

   elm_run();
   return 0;
}
ELM_MAIN()