647 |
(when (and (not args) xpandr) |
(when (and (not args) xpandr) |
648 |
(setq args (mapcar 'widget-convert (funcall xpandr tree))) |
(setq args (mapcar 'widget-convert (funcall xpandr tree))) |
649 |
(widget-put tree :args args)) |
(widget-put tree :args args)) |
650 |
|
;; Defer the node widget creation after icon creation. |
651 |
|
(widget-put tree :node (widget-convert node)) |
652 |
;; Create the icon widget for the expanded tree. |
;; Create the icon widget for the expanded tree. |
653 |
(push (widget-create-child-and-convert |
(push (widget-create-child-and-convert |
654 |
tree (widget-get tree (if args :open-icon :empty-icon)) |
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))) |
|
655 |
buttons) |
buttons) |
656 |
;; Create the tree node widget. |
;; Create the tree node widget. |
657 |
(push (widget-create-child tree node) children) |
(push (widget-create-child tree (widget-get tree :node)) |
658 |
|
children) |
659 |
;; Update the icon :node with the created node widget. |
;; Update the icon :node with the created node widget. |
660 |
(widget-put (car buttons) :node (car children)) |
(widget-put (car buttons) :node (car children)) |
661 |
;; Create the tree children. |
;; Create the tree children. |
697 |
;; Update the icon :node with the created node widget. |
;; Update the icon :node with the created node widget. |
698 |
(widget-put (car buttons) :node (car children))))) |
(widget-put (car buttons) :node (car children))))) |
699 |
;;;; Collapsed node. |
;;;; Collapsed node. |
700 |
|
;; Defer the node widget creation after icon creation. |
701 |
|
(widget-put tree :node (widget-convert node)) |
702 |
;; Create the icon widget for the collapsed tree. |
;; Create the icon widget for the collapsed tree. |
703 |
(push (widget-create-child-and-convert |
(push (widget-create-child-and-convert |
704 |
tree (widget-get tree :close-icon) |
tree (widget-get tree :close-icon)) |
|
;; At this point the node widget isn't yet created. |
|
|
:node (setq node (widget-convert node))) |
|
705 |
buttons) |
buttons) |
706 |
;; Create the tree node widget. |
;; Create the tree node widget. |
707 |
(push (widget-create-child tree node) children) |
(push (widget-create-child tree (widget-get tree :node)) |
708 |
|
children) |
709 |
;; Update the icon :node with the created node widget. |
;; Update the icon :node with the created node widget. |
710 |
(widget-put (car buttons) :node (car children))) |
(widget-put (car buttons) :node (car children))) |
711 |
;; Save widget children and buttons. The tree-widget :node child |
;; Save widget children and buttons. The tree-widget :node child |