examples: Show off usage of "background" part

See bg_cxx_example_01
This commit is contained in:
Jean-Philippe Andre 2018-01-16 22:04:21 +09:00
parent ccf90aa0e4
commit 5555726fef
1 changed files with 2 additions and 6 deletions

View File

@ -1,3 +1,4 @@
#define EFL_CXXPERIMENTAL // for background part
#include <Elementary.hh>
using efl::eo::instantiate;
@ -9,12 +10,7 @@ elm_main (int argc EINA_UNUSED, char **argv EINA_UNUSED)
win.text_set("Window Background");
win.autohide_set(true);
win.size_set({320,320});
try {
auto bg = efl::eo::downcast<efl::ui::win::Part>(win.part("background"));
bg.color_set(139, 69, 19, 255);
} catch (std::exception const&e) {
std::cerr << "Failed to set bg color: " << e.what() << std::endl;
}
win.background().color_set(139, 69, 19, 255);
// Clean exit
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);