diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-11-20 20:39:54 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-11-20 20:42:39 +0900 |
commit | 3a9aa6b93a054379888d804bae73d2e434928849 (patch) | |
tree | 363a3252b0e7feb4005f0d02be1f559a230b8066 /src | |
parent | eae0885e0aae65b8f79d58057b03e4091360f9b1 (diff) |
cxx: Fix slider example (bad downcast)
Diffstat (limited to 'src')
-rw-r--r-- | src/examples/elementary/slider_cxx_example.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/examples/elementary/slider_cxx_example.cc b/src/examples/elementary/slider_cxx_example.cc index b3b3676..aa2360f 100644 --- a/src/examples/elementary/slider_cxx_example.cc +++ b/src/examples/elementary/slider_cxx_example.cc | |||
@@ -4,14 +4,15 @@ | |||
4 | 4 | ||
5 | using efl::eo::instantiate; | 5 | using efl::eo::instantiate; |
6 | 6 | ||
7 | static efl::ui::Win win; | ||
8 | |||
7 | static void | 9 | static void |
8 | efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) | 10 | efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) |
9 | { | 11 | { |
10 | elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN); | 12 | win = efl::ui::Win(instantiate); |
11 | |||
12 | efl::ui::Win win(instantiate); | ||
13 | win.text_set("Slider example"); | 13 | win.text_set("Slider example"); |
14 | win.autohide_set(true); | 14 | efl::eolian::event_add(efl::ui::Win::delete_request_event, win, |
15 | std::bind([](){ win = nullptr; ::efl_exit(0); })); | ||
15 | 16 | ||
16 | efl::ui::Box bx(instantiate, win); | 17 | efl::ui::Box bx(instantiate, win); |
17 | win.content_set(bx); | 18 | win.content_set(bx); |
@@ -31,7 +32,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) | |||
31 | ic2.icon_set("folder"); | 32 | ic2.icon_set("folder"); |
32 | ic2.scalable_set(false, false); | 33 | ic2.scalable_set(false, false); |
33 | // FIXME: C++ part API needs special reference handling! This will show ERR! | 34 | // FIXME: C++ part API needs special reference handling! This will show ERR! |
34 | efl::eo::downcast<efl::Container>(sl2.part("elm.swallow.end")) | 35 | efl::eo::downcast<efl::Content>(sl2.part("elm.swallow.end")) |
35 | .content_set(ic2); | 36 | .content_set(ic2); |
36 | 37 | ||
37 | sl2.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5); | 38 | sl2.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5); |