2017-11-01 20:13:53 -07:00
|
|
|
// g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` box_cxx_example_02.cc -o box_cxx_example_02
|
2014-07-16 13:34:22 -07:00
|
|
|
|
2014-12-16 13:04:43 -08:00
|
|
|
#include <Elementary.hh>
|
2014-07-16 13:34:22 -07:00
|
|
|
|
2017-11-01 20:13:53 -07:00
|
|
|
using efl::eo::instantiate;
|
2014-07-21 09:35:11 -07:00
|
|
|
|
|
|
|
static void
|
2017-11-01 20:13:53 -07:00
|
|
|
efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
|
2014-07-16 13:34:22 -07:00
|
|
|
{
|
2014-12-16 13:04:43 -08:00
|
|
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
|
2014-07-16 13:34:22 -07:00
|
|
|
|
2017-11-05 21:25:22 -08:00
|
|
|
efl::ui::Win win(instantiate);
|
2017-11-01 20:13:53 -07:00
|
|
|
win.text_set("Simple Box Example");
|
2014-12-16 13:04:43 -08:00
|
|
|
win.autohide_set(true);
|
|
|
|
|
2017-11-05 21:25:22 -08:00
|
|
|
efl::ui::Box box(instantiate, win);
|
2017-11-01 20:13:53 -07:00
|
|
|
win.content_set(box);
|
2014-12-16 13:04:43 -08:00
|
|
|
|
2017-11-01 20:13:53 -07:00
|
|
|
for (int i = 0; i < 5; i++)
|
2014-12-16 13:04:43 -08:00
|
|
|
{
|
2017-11-12 18:43:04 -08:00
|
|
|
efl::ui::Button bt(instantiate, win);
|
2017-11-01 20:13:53 -07:00
|
|
|
bt.text_set("Button " + std::to_string(i));
|
|
|
|
box.pack_end(bt);
|
|
|
|
}
|
2014-12-16 13:04:43 -08:00
|
|
|
|
2017-11-01 20:13:53 -07:00
|
|
|
win.size_set({320,320});
|
2014-07-16 13:34:22 -07:00
|
|
|
}
|
2017-11-01 20:13:53 -07:00
|
|
|
EFL_MAIN()
|