Enlightenment CVS committal

Author  : rephorm
Project : e17
Module  : libs/etox

Dir     : e17/libs/etox/test


Modified Files:
        selections.c 


Log Message:

test out etox_selection_geometry_get().

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/etox/test/selections.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- selections.c        20 Aug 2003 17:38:04 -0000      1.13
+++ selections.c        4 Sep 2003 03:07:09 -0000       1.14
@@ -145,10 +145,14 @@
 {
   Etox_Selection *sel;
   Etox_Context *cont;
+  int i = 0;
 
 
   printf("style: %s\n", etox_context_get_style(etox_get_context(etox)));
-  sel = etox_select_index(etox, 10, 120);
+//  printf("before: %s\n", etox_get_text(etox));
+  sel = etox_select_index(etox, 4, 8);
+//  printf("after: %s\n", etox_get_text(etox));
+  //sel = etox_select_str(etox, "Etox", NULL);
 
   cont = etox_context_save(etox);
 
@@ -161,6 +165,27 @@
   sel = etox_select_index(etox, 50, 200);
   etox_context_set_color(cont, 200, 102, 10, 255);
   etox_selection_apply_context(sel, cont);
+
+  {
+    Etox_Rect *rects;
+    int num, i;
+
+    rects = etox_selection_get_geometry(sel, &num);
+
+    for (i=0; i<num; i++)
+    {
+      Etox_Rect *geom = rects + i;
+      Evas_Object *r;
+
+      printf("***(%f, %f) %f x %f\n", geom->x, geom->y, geom->w, geom->h);
+      r = evas_object_rectangle_add(evas);
+      evas_object_move(r, geom->x, geom->y);
+      evas_object_resize(r, geom->w, geom->h);
+      evas_object_layer_set(r, 2000);
+      evas_object_color_set(r, 255, 255, 255, 128);
+      evas_object_show(r);
+    }
+  }
 
   printf("style: %s\n", etox_context_get_style(etox_get_context(etox)));
   etox_append_text(etox, " Blah. Blah. Blum de dum.");




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to