2011-06-29 13:47:41 -07:00
|
|
|
//Compile with:
|
2012-03-19 05:58:07 -07:00
|
|
|
//gcc -o bubble_example_01 bubble_example_01.c -g `pkg-config --cflags --libs elementary`
|
2011-06-29 13:47:41 -07:00
|
|
|
|
|
|
|
#include <Elementary.h>
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
2012-03-27 17:51:57 -07:00
|
|
|
#else
|
|
|
|
# define __UNUSED__
|
2011-06-29 13:47:41 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
void
|
2012-03-26 16:46:53 -07:00
|
|
|
_bla(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
|
2011-06-29 13:47:41 -07:00
|
|
|
{
|
|
|
|
static unsigned char corner = 0;
|
2012-03-12 01:07:27 -07:00
|
|
|
++corner;
|
|
|
|
if (corner > 3)
|
|
|
|
elm_bubble_pos_set(obj, ELM_BUBBLE_POS_TOP_LEFT);
|
|
|
|
else
|
|
|
|
elm_bubble_pos_set(obj, corner);
|
|
|
|
|
2011-06-29 13:47:41 -07:00
|
|
|
}
|
|
|
|
|
2011-08-28 21:16:18 -07:00
|
|
|
EAPI_MAIN int
|
2012-03-26 16:46:53 -07:00
|
|
|
elm_main(int argc __UNUSED__, char **argv __UNUSED__)
|
2011-06-29 13:47:41 -07:00
|
|
|
{
|
|
|
|
Evas_Object *win, *bg, *bubble, *label, *icon;
|
|
|
|
|
|
|
|
win = elm_win_add(NULL, "bubble", ELM_WIN_BASIC);
|
|
|
|
elm_win_title_set(win, "Bubble");
|
|
|
|
elm_win_autodel_set(win, EINA_TRUE);
|
|
|
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
2012-03-19 05:58:07 -07:00
|
|
|
evas_object_resize(win, 300, 200);
|
|
|
|
evas_object_show(win);
|
2011-06-29 13:47:41 -07:00
|
|
|
|
|
|
|
bg = elm_bg_add(win);
|
2012-03-19 05:58:07 -07:00
|
|
|
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
2011-06-29 13:47:41 -07:00
|
|
|
elm_win_resize_object_add(win, bg);
|
|
|
|
evas_object_show(bg);
|
|
|
|
|
|
|
|
label = elm_label_add(win);
|
|
|
|
elm_object_text_set(label, "This is the CONTENT of our bubble");
|
|
|
|
evas_object_show(label);
|
|
|
|
|
|
|
|
icon = evas_object_rectangle_add(evas_object_evas_get(win));
|
|
|
|
evas_object_color_set(icon, 0, 0, 255, 255);
|
|
|
|
evas_object_show(icon);
|
|
|
|
|
|
|
|
bubble = elm_bubble_add(win);
|
2011-11-17 13:02:31 -08:00
|
|
|
elm_object_part_content_set(bubble, "icon", icon);
|
2012-03-06 03:43:04 -08:00
|
|
|
elm_object_part_text_set(bubble, "info", "INFO");
|
2011-09-14 04:30:21 -07:00
|
|
|
elm_object_text_set(bubble, "LABEL");
|
2012-03-05 22:54:02 -08:00
|
|
|
elm_object_content_set(bubble, label);
|
2011-06-29 13:47:41 -07:00
|
|
|
evas_object_resize(bubble, 300, 100);
|
|
|
|
evas_object_show(bubble);
|
|
|
|
|
|
|
|
evas_object_smart_callback_add(bubble, "clicked", _bla, NULL);
|
|
|
|
|
|
|
|
label = elm_label_add(win);
|
|
|
|
elm_object_text_set(label, "Bubble with no icon, info or label");
|
|
|
|
evas_object_show(label);
|
|
|
|
|
|
|
|
bubble = elm_bubble_add(win);
|
2012-03-05 22:54:02 -08:00
|
|
|
elm_object_content_set(bubble, label);
|
2011-06-29 13:47:41 -07:00
|
|
|
evas_object_resize(bubble, 200, 50);
|
|
|
|
evas_object_move(bubble, 0, 110);
|
|
|
|
evas_object_show(bubble);
|
|
|
|
|
|
|
|
elm_run();
|
2012-03-27 23:04:36 -07:00
|
|
|
elm_shutdown();
|
2011-06-29 13:47:41 -07:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
ELM_MAIN()
|