summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-11-07 22:21:13 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-11-07 22:21:13 +0900
commita0dc0eb5161f88507e3e44bb426ac26245aa6847 (patch)
tree85f16eaf088670c56de136da75f64979c2ea28ec
parent528dfce251e3fdf566379e27b262486da62e9e85 (diff)
downloadefl-a0dc0eb5161f88507e3e44bb426ac26245aa6847.tar.gz
cxx: Fix slider example
The fix is not complete. We need to make efl_part() work nicely in C++: - Get the refs work properly (maybe without auto-del) - Generate the parts from the EO file as methods on the object Final form should be close to: slider.indicator().format_string_set("%1.2f"); Where everything autocompletes nicely :)
-rw-r--r--src/examples/elementary/slider_cxx_example.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/examples/elementary/slider_cxx_example.cc b/src/examples/elementary/slider_cxx_example.cc
index 797e1bd5b6..b3b3676205 100644
--- a/src/examples/elementary/slider_cxx_example.cc
+++ b/src/examples/elementary/slider_cxx_example.cc
@@ -30,7 +30,9 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
efl::ui::Image ic2(instantiate, win);
ic2.icon_set("folder");
ic2.scalable_set(false, false);
- efl::eo::downcast<efl::Container>(sl2.part("end")).content_set(ic2);
+ // FIXME: C++ part API needs special reference handling! This will show ERR!
+ efl::eo::downcast<efl::Container>(sl2.part("elm.swallow.end"))
+ .content_set(ic2);
sl2.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5);
bx.pack_end(sl2);
@@ -48,8 +50,12 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
bx.pack_end(sl4);
efl::ui::Slider sl5(instantiate, win);
- sl5.indicator_format_set("%1.2f");
- sl4.direction_set(EFL_UI_DIR_UP);
+
+ // FIXME: C++ part API needs special reference handling! This will show ERR!
+ efl::eo::downcast<efl::ui::slider::Part>(sl5.part("indicator"))
+ .format_string_set("%1.2f");
+
+ sl5.direction_set(EFL_UI_DIR_UP);
sl5.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5);
bx.pack_end(sl5);