Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_tree.c ewl_tree.h 


Log Message:
Remove selected rows from the selection when they're destroyed.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_tree.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- ewl_tree.c  12 Jul 2005 18:02:51 -0000      1.9
+++ ewl_tree.c  12 Jul 2005 18:37:33 -0000      1.10
@@ -650,6 +650,8 @@
 
        ewl_callback_append(EWL_WIDGET(node), EWL_CALLBACK_CONFIGURE,
                        ewl_tree_node_configure_cb, NULL);
+       ewl_callback_append(EWL_WIDGET(node), EWL_CALLBACK_DESTROY,
+                           ewl_tree_node_destroy_cb, NULL);
 
        /*
         * The handle for expanding and collapsing the branch point at this
@@ -791,6 +793,27 @@
 }
 
 void
+ewl_tree_node_destroy_cb(Ewl_Widget * w, void *ev_data __UNUSED__,
+                                        void *user_data __UNUSED__)
+{
+       Ewl_Tree *tree;
+       Ewl_Tree_Node *node;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+
+       node = EWL_TREE_NODE(w);
+       if (!node->tree)
+               DRETURN(DLEVEL_STABLE);
+
+       tree = EWL_TREE(node->tree);
+       if (ecore_list_goto(tree->selected, node->row)) {
+               ecore_list_remove(tree->selected);
+       }
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+void
 ewl_tree_node_toggle_cb(Ewl_Widget * w __UNUSED__, void *ev_data __UNUSED__,
                                                        void *user_data)
 {
@@ -815,6 +838,10 @@
 ewl_tree_node_child_add_cb(Ewl_Container *c, Ewl_Widget *w __UNUSED__)
 {
        Ewl_Tree_Node *node = EWL_TREE_NODE(c);
+
+       if (w != node->handle && !node->row)
+               node->row = node->handle;
+
        if (ecore_list_nodes(c->children) > 2 ) {
                if (HIDDEN(node->handle))
                        ewl_widget_show(node->handle);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_tree.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ewl_tree.h  12 Jul 2005 18:12:51 -0000      1.7
+++ ewl_tree.h  12 Jul 2005 18:37:33 -0000      1.8
@@ -115,6 +115,7 @@
  * Internally used callbacks, override at your own risk.
  */
 void ewl_tree_node_configure_cb(Ewl_Widget *w, void *ev_data, void *user_data);
+void ewl_tree_node_destroy_cb(Ewl_Widget *w, void *ev_data, void *user_data);
 void ewl_tree_node_toggle_cb(Ewl_Widget *w, void *ev_data, void *user_data);
 
 void ewl_tree_node_child_show_cb(Ewl_Container *c, Ewl_Widget *w);




-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to