示例#1
0
interface_view *
create_about_view(interface *intf, Evas_Object *parent)
{
    interface_view *view = calloc(1, sizeof(*view));

    /* */
    view_sys *about_view_sys = calloc(1, sizeof(*about_view_sys));
    about_view_sys->p_intf = intf;
    about_view_sys->p_anim = malloc(sizeof(*about_view_sys->p_anim));

    view->p_view_sys = about_view_sys;

    /* Content box */
    Evas_Object *about_box = elm_box_add(parent);
    evas_object_size_hint_weight_set(about_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(about_box, EVAS_HINT_FILL, EVAS_HINT_FILL);

    /* Toolbar Naviframe */
    Evas_Object *nf_toolbar = about_view_sys->nf_toolbar = elm_naviframe_add(about_box);
    evas_object_size_hint_weight_set(nf_toolbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(nf_toolbar, EVAS_HINT_FILL, EVAS_HINT_FILL);

    /* Create the toolbar in the view */
    Evas_Object *tabbar = create_toolbar(about_view_sys);

    /* Add them to the box */
    elm_box_pack_end(about_box, tabbar);
    evas_object_show(tabbar);
    elm_box_pack_end(about_box, nf_toolbar);
    evas_object_show(nf_toolbar);

    /* Set the first item in the toolbar */
    elm_toolbar_item_selected_set(elm_toolbar_first_item_get(tabbar), EINA_TRUE);

    /* Rotation */
    Evas_Object *win = intf_get_window(about_view_sys->p_intf);
    evas_object_smart_callback_add(win, "wm,rotation,changed", rotation_cb, about_view_sys);

    /*  */
    evas_object_show(about_box);
    view->view = about_box;
    return view;
}
示例#2
0
void _response_cb (void *data, Evas_Object *obj, void *event_info)  {
	if((event_info == elm_toolbar_first_item_get((Evas_Object *)obj)))
		send_response(SUCCESS);
}