Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/bin


Modified Files:
        ewl_text_test.c 


Log Message:
- change the trigger code a bit. remove the trigger_add and trigger_del
  calls. You now just ewl_container_child_append the trigger into the text
  and it will figure it out from there

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/bin/ewl_text_test.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ewl_text_test.c     21 Jul 2005 00:47:57 -0000      1.2
+++ ewl_text_test.c     21 Jul 2005 04:04:32 -0000      1.3
@@ -51,6 +51,7 @@
 {
        Ewl_Widget *win, *o;
        Ewl_Text_Trigger *trigger;
+       int len;
 
        text_button = w;
 
@@ -96,13 +97,14 @@
        ewl_text_text_insert(EWL_TEXT(o), "The fourth bunch of text\n", 31); /* 
25 */
 
         trigger = ewl_text_trigger_new(EWL_TEXT_TRIGGER_TYPE_TRIGGER);
-       trigger->pos = ewl_text_length_get(EWL_TEXT(o));
-
+       ewl_text_trigger_start_pos_set(trigger, 
ewl_text_length_get(EWL_TEXT(o)));
        ewl_text_text_append(EWL_TEXT(o), "This is the link."); /* 17 */
 
-       trigger->len = ewl_text_cursor_position_get(EWL_TEXT(o)) - trigger->pos 
+ 1;
+       len = ewl_text_cursor_position_get(EWL_TEXT(o)) - 
+                       ewl_text_trigger_start_pos_get(trigger) + 1;
+       ewl_text_trigger_length_set(trigger, len);
 
-       ewl_text_trigger_add(EWL_TEXT(o), trigger);
+       ewl_container_child_append(EWL_CONTAINER(o), EWL_WIDGET(trigger));
        ewl_callback_append(EWL_WIDGET(trigger), EWL_CALLBACK_MOUSE_UP, 
                        __trigger_cb, "You clicked the trigger, have a 
cookie.");
        ewl_callback_append(EWL_WIDGET(trigger), EWL_CALLBACK_FOCUS_IN,
@@ -110,7 +112,6 @@
        ewl_callback_append(EWL_WIDGET(trigger), EWL_CALLBACK_FOCUS_OUT,
                        __trigger_cb_mouse_out, NULL);
 
-
        ewl_text_text_insert(EWL_TEXT(o), "The fifth bunch of text\n", 0); /* 
24 */
 
        ewl_text_cursor_position_set(EWL_TEXT(o), 0);




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to