forked from enlightenment/efl
examples: Show off usage of "background" part
See bg_cxx_example_01
This commit is contained in:
parent
ccf90aa0e4
commit
5555726fef
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue