'--- radio_example2.bac
'--- Ported to BaCon by bigbass
PRAGMA LDFLAGS `pkg-config --libs elementary `
PRAGMA OPTIONS `pkg-config --cflags elementary `
PRAGMA INCLUDE elementary-1/Elementary.h
'---elm_ commands
PROTO elm_main
PROTO elm_policy_set
PROTO elm_win_util_standard_add
PROTO elm_win_autodel_set
PROTO elm_box_add
PROTO elm_box_horizontal_set
PROTO elm_win_resize_object_add
PROTO elm_object_text_set
PROTO elm_radio_state_value_set
PROTO elm_radio_value_pointer_set
PROTO elm_icon_add
PROTO elm_icon_standard_set
PROTO elm_object_part_content_set
PROTO elm_box_pack_end
PROTO elm_radio_add
PROTO elm_object_text_set
PROTO elm_radio_state_value_set
PROTO elm_radio_value_pointer_set
PROTO elm_radio_group_add
PROTO elm_icon_add
PROTO elm_icon_standard_set
PROTO elm_object_part_content_set
PROTO elm_box_pack_end
PROTO elm_radio_add
PROTO elm_object_text_set
PROTO elm_radio_state_value_set
PROTO elm_radio_value_pointer_set
PROTO elm_radio_group_add
PROTO elm_box_pack_end
PROTO elm_radio_add
PROTO elm_object_text_set
PROTO elm_radio_state_value_set
PROTO elm_radio_value_pointer_set
PROTO elm_radio_group_add
PROTO elm_box_pack_end
PROTO elm_run
PROTO elm_shutdown
'---evas_ commands
PROTO evas_object_size_hint_weight_set
PROTO evas_object_show
PROTO evas_object_size_hint_weight_set
PROTO evas_object_size_hint_align_set
PROTO evas_object_show
PROTO evas_object_smart_callback_add
PROTO evas_object_size_hint_weight_set
PROTO evas_object_size_hint_align_set
PROTO evas_object_show
PROTO evas_object_smart_callback_add
PROTO evas_object_size_hint_weight_set
PROTO evas_object_size_hint_align_set
PROTO evas_object_show
PROTO evas_object_smart_callback_add
PROTO evas_object_size_hint_weight_set
PROTO evas_object_size_hint_align_set
PROTO evas_object_show
PROTO evas_object_smart_callback_add
PROTO evas_object_show
PROTO elm_init
'--- added size
PROTO evas_object_resize
'===========================================================
SUB _cb(void *data, Evas_Object *obj, void *event_info)
'===========================================================
PRINT "val is now: ", val
END SUB
elm_init(0, 0)
DECLARE val TYPE int
val = 1
DECLARE *win, *bx, *radio, *group, *ic TYPE Evas_Object
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED)
win = elm_win_util_standard_add("radio", "Radio")
elm_win_autodel_set(win, EINA_TRUE)
bx = elm_box_add(win)
elm_box_horizontal_set(bx, EINA_TRUE)
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND)
elm_win_resize_object_add(win, bx)
evas_object_resize(win, 400, 30)
evas_object_show(bx)
radio = elm_radio_add(win)
'--- you need to do this so that there is only one active button !
group = radio
elm_object_text_set(radio, "1")
elm_radio_state_value_set(radio, 1)
elm_radio_value_pointer_set(radio, &val)
ic = elm_icon_add(win)
elm_icon_standard_set(ic, "home")
elm_object_part_content_set(radio, "icon", ic)
elm_box_pack_end(bx, radio)
evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND)
evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL)
evas_object_show(radio)
evas_object_smart_callback_add(radio, "changed", _cb, NULL)
radio = elm_radio_add(win)
elm_object_text_set(radio, "2")
elm_radio_state_value_set(radio, 2)
elm_radio_value_pointer_set(radio, &val)
elm_radio_group_add(radio, group)
ic = elm_icon_add(win)
elm_icon_standard_set(ic, "file")
elm_object_part_content_set(radio, "icon", ic)
elm_box_pack_end(bx, radio)
evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND)
evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL)
evas_object_show(radio)
evas_object_smart_callback_add(radio, "changed", _cb, NULL)
radio = elm_radio_add(win)
elm_object_text_set(radio, "3")
elm_radio_state_value_set(radio, 3)
elm_radio_value_pointer_set(radio, &val)
elm_radio_group_add(radio, group)
elm_box_pack_end(bx, radio)
evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND)
evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL)
evas_object_show(radio)
evas_object_smart_callback_add(radio, "changed", _cb, NULL)
radio = elm_radio_add(win)
elm_object_text_set(radio, "4")
elm_radio_state_value_set(radio, 4)
elm_radio_value_pointer_set(radio, &val)
elm_radio_group_add(radio, group)
elm_box_pack_end(bx, radio)
evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND)
evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL)
evas_object_show(radio)
evas_object_smart_callback_add(radio, "changed", _cb, NULL)
evas_object_show(win)
elm_run()
elm_shutdown()