Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/bin/tests


Modified Files:
        ewl_list.c 


Log Message:
- the ewl_list widget will now keep track of the last selected item in the
  list.
  - When the selected item changes a EWL_CALLBACK_VALUE_CHANGED callback
    will be fired.

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/ewl_list.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ewl_list.c  14 Jul 2006 02:53:34 -0000      1.1
+++ ewl_list.c  17 Jul 2006 04:39:06 -0000      1.2
@@ -21,6 +21,7 @@
 static int create_test(Ewl_Container *win);
 
 static void *list_test_data_setup(void);
+static void list_cb_value_changed(Ewl_Widget *w, void *ev, void *data);
 
 static void list_test_assign_set(Ewl_Widget *w, void *data);
 static void *list_test_data_fetch(void *data, unsigned int row, 
@@ -73,6 +74,8 @@
        ewl_list_model_set(EWL_LIST(list), model);
        ewl_list_view_set(EWL_LIST(list), view);
        ewl_list_data_set(EWL_LIST(list), str_data);
+       ewl_callback_append(list, EWL_CALLBACK_VALUE_CHANGED, 
+                                       list_cb_value_changed, NULL);
        ewl_widget_show(list);
 
 
@@ -186,4 +189,19 @@
 
        return d->count;
 }
+
+static void
+list_cb_value_changed(Ewl_Widget *w, void *ev, void *data)
+{
+       Ewl_List *list;
+       Ecore_List *el;
+
+       list = EWL_LIST(w);
+       el = ewl_list_data_get(list);
+
+       ecore_list_goto_index(el, ewl_list_selected_index_get(list));
+       printf("Selected (%s)\n", (char *)ecore_list_current(el));
+
+}
+
 




-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to