-#include <Elementary.h>
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif
+#include <Elementary.h>
#ifndef ELM_LIB_QUICKLAUNCH
static void
+_cb_size_radio_changed(void *data, Evas_Object *obj, void *event __UNUSED__)
+{
+ Evas_Object *o_bg = data;
+ int size;
+ size = elm_radio_value_get((Evas_Object *)obj);
+ elm_bg_load_size_set(o_bg, size, size);
+}
+
+static void
_cb_radio_changed(void *data, Evas_Object *obj, void *event __UNUSED__)
{
Evas_Object *o_bg = data;
test_bg_image(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Evas_Object *win, *bg;
+ Evas_Object *box, *hbox, *o_bg;
+ Evas_Object *rd, *rdg;
char buf[PATH_MAX];
win = elm_win_add(NULL, "bg-image", ELM_WIN_BASIC);
elm_win_autodel_set(win, EINA_TRUE);
bg = elm_bg_add(win);
- snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
- elm_bg_file_set(bg, buf, NULL);
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, bg);
evas_object_show(bg);
+ box = elm_box_add(win);
+ evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(win, box);
+ evas_object_show(box);
+
+ o_bg = elm_bg_add(win);
+ snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
+ elm_bg_file_set(o_bg, buf, NULL);
+ evas_object_size_hint_weight_set(o_bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(o_bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_box_pack_end(box, o_bg);
+
+ hbox = elm_box_add(win);
+ elm_box_horizontal_set(hbox, EINA_TRUE);
+ evas_object_size_hint_weight_set(hbox, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
+ evas_object_size_hint_align_set(hbox, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ rd = elm_radio_add(win);
+ elm_radio_state_value_set(rd, 50);
+ elm_object_text_set(rd, "50 x 50");
+ evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
+ evas_object_smart_callback_add(rd, "changed", _cb_size_radio_changed, o_bg);
+ elm_box_pack_end(hbox, rd);
+ evas_object_show(rd);
+ rdg = rd;
+
+ rd = elm_radio_add(win);
+ elm_radio_state_value_set(rd, 100);
+ elm_radio_group_add(rd, rdg);
+ elm_object_text_set(rd, "100 x 100");
+ evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
+ evas_object_smart_callback_add(rd, "changed", _cb_size_radio_changed, o_bg);
+ elm_box_pack_end(hbox, rd);
+ evas_object_show(rd);
+
+ rd = elm_radio_add(win);
+ elm_radio_state_value_set(rd, 200);
+ elm_radio_group_add(rd, rdg);
+ elm_object_text_set(rd, "200 x 200");
+ evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
+ evas_object_smart_callback_add(rd, "changed", _cb_size_radio_changed, o_bg);
+ elm_box_pack_end(hbox, rd);
+ evas_object_show(rd);
+
+ elm_radio_value_set(rdg, 200);
+
+ elm_box_pack_end(box, hbox);
+ evas_object_show(hbox);
+
+ evas_object_show(o_bg);
evas_object_size_hint_min_set(bg, 160, 160);
evas_object_size_hint_max_set(bg, 640, 640);
evas_object_resize(win, 320, 320);