# HG changeset patch # User David Ponce # Date 1127123491 0 # Node ID cc7dd4ad84cd06b94d0ed01ff167cb4d0c5604b6 # Parent 19d18ffa4da3d15aad2e4b793eefae4faf7d03de (tree-widget-value-create): Save the converted tree :node widget. diff -r 19d18ffa4da3 -r cc7dd4ad84cd lisp/tree-widget.el --- 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