hello-gui: Reduce to a minimal Efl.Ui app
This commit is contained in:
parent
95c0ffad65
commit
36b64dfca1
|
@ -5,14 +5,6 @@
|
||||||
#include <Elementary.h>
|
#include <Elementary.h>
|
||||||
#include <Efl_Ui.h>
|
#include <Efl_Ui.h>
|
||||||
|
|
||||||
static void
|
|
||||||
_gui_editor_changed_cb(void *data, const Efl_Event *event EINA_UNUSED)
|
|
||||||
{
|
|
||||||
Eo *editor = data;
|
|
||||||
|
|
||||||
printf("Change recorded: %s\n", efl_text_get(editor));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_gui_quit_clicked_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
|
_gui_quit_clicked_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
|
||||||
{
|
{
|
||||||
|
@ -22,7 +14,7 @@ _gui_quit_clicked_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
|
||||||
static void
|
static void
|
||||||
_gui_setup()
|
_gui_setup()
|
||||||
{
|
{
|
||||||
Eo *win, *box, *editor;
|
Eo *win, *box;
|
||||||
|
|
||||||
win = efl_add(EFL_UI_WIN_CLASS, NULL,
|
win = efl_add(EFL_UI_WIN_CLASS, NULL,
|
||||||
efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
|
efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
|
||||||
|
@ -33,25 +25,12 @@ _gui_setup()
|
||||||
efl_content_set(win, efl_added),
|
efl_content_set(win, efl_added),
|
||||||
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(360, 240)));
|
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(360, 240)));
|
||||||
|
|
||||||
// TODO make this a single label with anewline in it
|
|
||||||
efl_add(EFL_UI_TEXT_CLASS, box,
|
efl_add(EFL_UI_TEXT_CLASS, box,
|
||||||
efl_text_set(efl_added, "Hello World."),
|
efl_text_markup_set(efl_added, "Hello World.<br>This is an <b>Efl.Ui</b> application!"),
|
||||||
efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.1),
|
efl_ui_text_interactive_selection_allowed_set(efl_added, EINA_FALSE),
|
||||||
|
efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.9),
|
||||||
efl_gfx_size_hint_align_set(efl_added, 0.5, 0.5),
|
efl_gfx_size_hint_align_set(efl_added, 0.5, 0.5),
|
||||||
efl_pack(box, efl_added));
|
efl_pack(box, efl_added));
|
||||||
efl_add(EFL_UI_TEXT_CLASS, box,
|
|
||||||
efl_text_set(efl_added, "You can edit the text below to generate change events..."),
|
|
||||||
efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.1),
|
|
||||||
efl_gfx_size_hint_align_set(efl_added, 0.5, 0.5),
|
|
||||||
efl_pack(box, efl_added));
|
|
||||||
|
|
||||||
editor = efl_add(EFL_UI_TEXT_CLASS, box,
|
|
||||||
efl_text_set(efl_added, "Edit me"),
|
|
||||||
efl_ui_text_interactive_editable_set(efl_added, EINA_TRUE),
|
|
||||||
efl_ui_text_scrollable_set(efl_added, EINA_TRUE),
|
|
||||||
efl_pack(box, efl_added));
|
|
||||||
efl_event_callback_add(editor, EFL_UI_TEXT_EVENT_CHANGED_USER,
|
|
||||||
_gui_editor_changed_cb, editor);
|
|
||||||
|
|
||||||
efl_add(EFL_UI_BUTTON_CLASS, box,
|
efl_add(EFL_UI_BUTTON_CLASS, box,
|
||||||
efl_text_set(efl_added, "Quit"),
|
efl_text_set(efl_added, "Quit"),
|
||||||
|
|
Loading…
Reference in New Issue