1 #include <Elementary.h>
3 # include "elementary_config.h"
5 #ifndef ELM_LIB_QUICKLAUNCH
8 _print_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
10 printf("bubble clicked\n");
14 test_bubble(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
16 Evas_Object *win, *bg, *bx, *ic, *bb, *ct;
19 win = elm_win_add(NULL, "box-vert", ELM_WIN_BASIC);
20 elm_win_title_set(win, "Bubble");
21 elm_win_autodel_set(win, EINA_TRUE);
24 elm_win_resize_object_add(win, bg);
25 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
28 bx = elm_box_add(win);
29 elm_win_resize_object_add(win, bx);
30 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
33 ic = elm_icon_add(win);
34 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
35 elm_icon_file_set(ic, buf, NULL);
36 elm_icon_scale_set(ic, 0, 0);
37 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_HORIZONTAL, 1, 1);
39 bb = elm_bubble_add(win);
40 elm_object_text_set(bb, "Message 1");
41 elm_object_text_part_set(bb, "info", "Corner: bottom_right");
42 elm_object_content_part_set(bb, "icon", ic);
43 elm_bubble_corner_set(bb, "bottom_right");
44 evas_object_smart_callback_add(bb, "clicked", _print_clicked, NULL);
46 evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);
47 evas_object_size_hint_align_set(bb, EVAS_HINT_FILL, EVAS_HINT_FILL);
49 ct = elm_label_add(win);
50 elm_object_text_set(ct,
51 "\"The future of the art: R or G or B?\", by Rusty");
52 elm_object_content_set(bb, ct);
54 elm_box_pack_end(bx, bb);
57 bb = elm_bubble_add(win);
58 elm_object_text_set(bb, "Message 2");
59 elm_object_part_text_set(bb, "info", "10:32 4/11/2008");
60 evas_object_smart_callback_add(bb, "clicked", _print_clicked, NULL);
61 evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);
62 evas_object_size_hint_align_set(bb, EVAS_HINT_FILL, EVAS_HINT_FILL);
64 ct = elm_label_add(win);
65 elm_object_text_set(ct, "Corner: base (top-left) - no icon");
66 elm_object_content_set(bb, ct);
68 elm_box_pack_end(bx, bb);
71 evas_object_show(win);