application/main.c

changeset 127
ce342364fad5
parent 126
f190d03dce0f
child 133
6dd780cbc8c6
--- a/application/main.c	Wed Jul 13 15:35:59 2016 +0200
+++ b/application/main.c	Wed Jul 13 16:40:59 2016 +0200
@@ -63,11 +63,8 @@
     printf("scroll\n");
 }
 
-/*
+
 void draw(UiEvent *event, UiGraphics *g, void *data) {
-    double adjust = range.get(&range);
-    
-    ///*
     int width = g->width;
     int height = g->height;
     //printf("rec[%d,%d]\n", width, height);
@@ -75,29 +72,9 @@
     ui_graphics_color(g, 64, 64, 64);
     ui_draw_rect(g, 0, 0, width, height, TRUE);
     
-    if(!text) {
-        text = ui_text(g);
-        ui_text_setfont(text, "Monospace", 12);
-        ui_text_setstring(text, "Hello World");
-    }
-    int w, h;
-    ui_text_getsize(text, &w, &h);
-    //printf("ext[%d,%d]\n", w, h);
     
-    ui_graphics_color(g, 255, 255, 255);
-    ui_draw_text(g, 50, 50 + adjust, text);
-    ui_draw_line(g, 50, 55 + h, 50+w, 55 +h);
-    ui_draw_line(g, 50, 55 + h, 50, 75 +h);
-    
-    ui_draw_line(g, 0, 120, width, 120);
-    ui_draw_line(g, 200, 0, 200, height);
-    
-    ui_draw_rect(g, 250, 250, 50, 50, FALSE);
-    
-    //ui_text_free(text);
-    //*/
-    /*
 }
+/*
 
 void* model_getval(void *obj, int col) {
     if(col == 0) {
@@ -151,7 +128,7 @@
     
     UiObject *obj = ui_window("Test", NULL);
     //ui_context_closefunc(obj->ctx, window_close, NULL);
-
+    ui_drawingarea(obj, draw, NULL);
     
     ui_show(obj);
     ui_main();

mercurial