Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 70 lines (56 sloc) 2.469 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
#define _GNU_SOURCE
#include <Elementary.h>

static void
on_done(void *data, Evas_Object *obj, void *event_info) {
    elm_exit();
}

EAPI_MAIN int
elm_main(int argc, char **argv) {
    Evas_Object *win, *mainbox, *sidebox, *label, *button, *grid, *gridframe;

    win = elm_win_util_standard_add("fluidtest", "Fluids Test");
    evas_object_smart_callback_add(win, "delete,request", on_done, NULL);

    mainbox = elm_box_add(win);
    elm_box_horizontal_set(mainbox, EINA_TRUE);
    elm_box_homogeneous_set(mainbox, EINA_FALSE);
    elm_win_resize_object_add(win, mainbox);
    evas_object_size_hint_weight_set(mainbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_show(mainbox);

    grid = evas_object_rectangle_add(evas_object_evas_get(win));
    elm_win_resize_object_add(win, grid);
    evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_min_set(grid, 30, 30);
    evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
    evas_object_color_set(grid, 0, 0, 255, 255);
    //elm_box_pack_start(mainbox, grid);
    evas_object_show(grid);

    gridframe = elm_frame_add(win);
    elm_object_content_set(gridframe, grid);
    elm_object_text_set(gridframe, "Step 0");
    elm_box_pack_start(mainbox, gridframe);
    //elm_win_resize_object_add(win, gridframe);
    evas_object_size_hint_weight_set(gridframe, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    //evas_object_size_hint_min_set(grid, 30, 30);
    evas_object_size_hint_align_set(gridframe, EVAS_HINT_FILL, EVAS_HINT_FILL);
    evas_object_show(gridframe);

    sidebox = elm_box_add(win);
    elm_box_horizontal_set(sidebox, EINA_FALSE);
    //elm_win_resize_object_add(win, sidebox);
    //evas_object_size_hint_weight_set(sidebox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_weight_set(sidebox, 0, 0);

    label = elm_label_add(win);
    elm_object_text_set(label, "Fluids Test");
    elm_box_pack_end(sidebox, label);
    evas_object_show(label);

    button = elm_button_add(win);
    elm_object_text_set(button, "Exit");
    elm_box_pack_end(sidebox, button);
    evas_object_show(button);

    elm_box_pack_end(mainbox, sidebox);
    evas_object_show(sidebox);

    evas_object_smart_callback_add(button, "clicked", on_done, NULL);

    evas_object_show(win);

    elm_run(); // run main loop
    elm_shutdown(); // after mainloop finishes running, shutdown
    return 0; // exit 0 for exit code
}
ELM_MAIN()
Something went wrong with that request. Please try again.