changeset 65613:cc7dd4ad84cd

(tree-widget-value-create): Save the converted tree :node widget.
author David Ponce <david@dponce.com>
date Mon, 19 Sep 2005 09:51:31 +0000
parents 19d18ffa4da3
children 550b69cb1820
files lisp/tree-widget.el
diffstat 1 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/tree-widget.el	Mon Sep 19 09:37:35 2005 +0000
+++ b/lisp/tree-widget.el	Mon Sep 19 09:51:31 2005 +0000
@@ -647,14 +647,15 @@
           (when (and (not args) xpandr)
             (setq args (mapcar 'widget-convert (funcall xpandr tree)))
             (widget-put tree :args args))
+          ;; Defer the node widget creation after icon creation.
+          (widget-put tree :node (widget-convert node))
           ;; Create the icon widget for the expanded tree.
           (push (widget-create-child-and-convert
-                 tree (widget-get tree (if args :open-icon :empty-icon))
-                 ;; At this point the node widget isn't yet created.
-                 :node (setq node (widget-convert node)))
+                 tree (widget-get tree (if args :open-icon :empty-icon)))
                 buttons)
           ;; Create the tree node widget.
-          (push (widget-create-child tree node) children)
+          (push (widget-create-child tree (widget-get tree :node))
+                children)
           ;; Update the icon :node with the created node widget.
           (widget-put (car buttons) :node (car children))
           ;; Create the tree children.
@@ -696,14 +697,15 @@
               ;; Update the icon :node with the created node widget.
               (widget-put (car buttons) :node (car children)))))
 ;;;; Collapsed node.
+      ;; Defer the node widget creation after icon creation.
+      (widget-put tree :node (widget-convert node))
       ;; Create the icon widget for the collapsed tree.
       (push (widget-create-child-and-convert
-             tree (widget-get tree :close-icon)
-             ;; At this point the node widget isn't yet created.
-             :node (setq node (widget-convert node)))
+             tree (widget-get tree :close-icon))
             buttons)
       ;; Create the tree node widget.
-      (push (widget-create-child tree node) children)
+      (push (widget-create-child tree (widget-get tree :node))
+            children)
       ;; Update the icon :node with the created node widget.
       (widget-put (car buttons) :node (car children)))
     ;; Save widget children and buttons.  The tree-widget :node child