ajwillia-ms pushed a commit to branch master. http://git.enlightenment.org/tools/examples.git/commit/?id=36b64dfca1803dbf1468c279b6c0cec10943cf52
commit 36b64dfca1803dbf1468c279b6c0cec10943cf52 Author: Andy Williams <a...@andywilliams.me> Date: Wed Dec 6 13:12:07 2017 +0000 hello-gui: Reduce to a minimal Efl.Ui app --- tutorial/c/hello-gui/src/gui_main.c | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/tutorial/c/hello-gui/src/gui_main.c b/tutorial/c/hello-gui/src/gui_main.c index a53d6b7..a95e9d8 100644 --- a/tutorial/c/hello-gui/src/gui_main.c +++ b/tutorial/c/hello-gui/src/gui_main.c @@ -6,14 +6,6 @@ #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 _gui_quit_clicked_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED) { efl_exit(0); @@ -22,7 +14,7 @@ _gui_quit_clicked_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED) static void _gui_setup() { - Eo *win, *box, *editor; + Eo *win, *box; win = efl_add(EFL_UI_WIN_CLASS, NULL, efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC), @@ -33,25 +25,12 @@ _gui_setup() efl_content_set(win, efl_added), 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_text_set(efl_added, "Hello World."), - efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.1), + efl_text_markup_set(efl_added, "Hello World.<br>This is an <b>Efl.Ui</b> application!"), + 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_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_text_set(efl_added, "Quit"), --