#include <Elementary.hh>
EAPI_MAIN int
elm_main (int argc, char *argv[])
{
bx.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
bx.visible_set(true);
sl.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
sl.size_hint_align_set(EVAS_HINT_FILL, 0.5);
sl.visible_set(true);
sl2.text_set("elm.text", "Counter");
ic.resizable_set(false, false);
sl2.content_set("icon", ic);
ic2.standard_set("folder");
ic2.resizable_set(false, false);
sl2.content_set("end", ic2);
sl2.size_hint_align_set(EVAS_HINT_FILL, 0.5);
sl2.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
sl2.visible_set(true);
sl3.size_hint_align_set(EVAS_HINT_FILL, 0.5);
sl3.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
sl3.visible_set(true);
sl4.
unit_format_set(
"%1.0f units");
sl4.size_hint_align_set(EVAS_HINT_FILL, 0.5);
sl4.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
sl4.visible_set(true);
sl5.
indicator_format_set(
"%1.2f");
sl5.size_hint_align_set(EVAS_HINT_FILL, 0.5);
sl5.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
sl5.visible_set(true);
sl6.
horizontal_set(
false);
auto indicator_format = [] (double val) {
char *indicator = new char[32];
snprintf(indicator, 32, "%1.2f u", val);
return indicator;
};
auto indicator_free = [] (char *obj) {delete obj;} ;
sl6.
indicator_format_function_set(indicator_format, indicator_free);
sl6.size_hint_align_set(0.5, EVAS_HINT_FILL);
sl6.size_hint_weight_set(0, EVAS_HINT_EXPAND);
sl6.visible_set(true);
sl7.unit_format_set("%1.3f units");
sl7.indicator_format_function_set(indicator_format, indicator_free);
sl7.size_hint_align_set(EVAS_HINT_FILL, 0.5);
sl7.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
sl7.visible_set(true);
{
double val = obj.
value_get();
std::cout << "Changed to " << val << std::endl;
} , std::placeholders::_1 );
{
double val = obj.value_get();
std::cout << "Delay changed to " << val << std::endl;
} , std::placeholders::_1 );
sl7.
callback_changed_add(changed);
sl7.
callback_delay_changed_add(delay);
win.visible_set(true);
return 0;
}