Advertisement
Guest User

Untitled

a guest
Aug 13th, 2017
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.91 KB | None | 0 0
  1. #ifndef EFL_BETA_API_SUPPORT
  2. #define EFL_BETA_API_SUPPORT
  3. #endif
  4. #ifndef EFL_EO_API_SUPPORT
  5. #define EFL_EO_API_SUPPORT
  6. #endif
  7. #ifndef ELM_INTERNAL_API_ARGESFSDFEFC
  8. #define ELM_INTERNAL_API_ARGESFSDFEFC
  9. #endif
  10.  
  11. #include <Elementary.h>
  12. #include <Eo.h>
  13.  
  14. #define ELM_WIDGET_PROTECTED
  15. #include "elm_widget.h"
  16. #include "elm_widget_container.h"
  17. #include "elm_interface_scrollable.h"
  18.  
  19.  
  20. void
  21. win_1_create()
  22. {
  23.    Eo *win_1 = efl_add(EFL_UI_WIN_CLASS, NULL,
  24.          efl_text_set(efl_added, "Label"),
  25.          efl_ui_win_name_set(efl_added, "label"),
  26.          efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC));
  27.    efl_ui_win_autodel_set(win_1, EINA_TRUE);
  28.    efl_gfx_size_set(win_1, 320, 300);
  29.  
  30.    Eo *box_1 = elm_box_add(win_1);
  31.    efl_gfx_size_hint_weight_set(box_1, 1, 1);
  32.  
  33.    Eo *label_1 = efl_add(ELM_LABEL_CLASS, box_1);
  34.    elm_obj_widget_part_text_set(label_1, NULL, "<b>This is a small label</b>");
  35.    efl_gfx_size_hint_weight_set(label_1, 0, 0);
  36.    efl_gfx_size_hint_align_set(label_1, -1, -1);
  37.    elm_box_pack_end(box_1, label_1);
  38.  
  39.    Eo *label_2 = efl_add(ELM_LABEL_CLASS, box_1);
  40.    elm_obj_widget_part_text_set(label_2, NULL, "This is a larger label with newlines<br/>to make it bigger, bit it won't expand or wrap<br/>just be a block of text that can't change its<br/>formatting as it's fixed based on text<br/>");
  41.    efl_gfx_size_hint_weight_set(label_2, 0, 0);
  42.    efl_gfx_size_hint_align_set(label_2, -1, -1);
  43.    elm_box_pack_end(box_1, label_2);
  44.  
  45.    Eo *label_3 = efl_add(ELM_LABEL_CLASS, box_1);
  46.    elm_obj_label_line_wrap_set(label_3, ELM_WRAP_CHAR);
  47.    elm_obj_widget_part_text_set(label_3, NULL, "<b>This is more text designed to line-wrap here as This object is resized horizontally. As it is resized vertically though, nothing should change. The amount of space allocated vertically should change as horizontal size changes.</b>");
  48.    efl_gfx_size_hint_weight_set(label_3, 1, 0);
  49.    efl_gfx_size_hint_align_set(label_3, -1, -1);
  50.    elm_box_pack_end(box_1, label_3);
  51.  
  52.    Eo *label_4 = efl_add(ELM_LABEL_CLASS, box_1);
  53.    elm_obj_widget_part_text_set(label_4, NULL, "This small label set to wrap");
  54.    efl_gfx_size_hint_weight_set(label_4, 1, 0);
  55.    efl_gfx_size_hint_align_set(label_4, -1, -1);
  56.    elm_box_pack_end(box_1, label_4);
  57.  
  58.    Eo *label_5 = efl_add(ELM_LABEL_CLASS, box_1);
  59.    elm_obj_widget_part_text_set(label_5, NULL, "You can also use all the default entry style tags, like <hilight>hilight</hilight>, <success>success</success>, <bigger>bigger</bigger>, <smaller>smaller</smaller>, etc...");
  60.    elm_obj_label_line_wrap_set(label_5, ELM_WRAP_WORD);
  61.    efl_gfx_size_hint_weight_set(label_5, 1, 0);
  62.    efl_gfx_size_hint_align_set(label_5, -1, -1);
  63.    elm_box_pack_end(box_1, label_5);
  64.  
  65.    efl_gfx_visible_set(win_1, EINA_TRUE);
  66.    efl_content_set(win_1, box_1);
  67. }
  68.  
  69. EAPI_MAIN void efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
  70. {
  71.    win_1_create(NULL);
  72. }
  73. EFL_MAIN()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement