86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
(let* ((newpath (append pathl (list hed)))
(parentnode (tree:find-node obj pathl))
(nodenum (tree:find-node obj newpath)))
;; Add the branch under lastnode if not found
(if (not nodenum)
(begin
(iup:attribute-set! obj (conc "ADDBRANCH" parentnode) hed)
(if userdata
(iup:attribute-set! obj (conc "USERDATA" parentnode) userdata))
(if (null? tal)
#t
;; reset to top
(loop (car nodelst)(cdr nodelst) 1 (list top))))
(if (null? tal) ;; if null here then this path has already been added
|
>
|
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
(let* ((newpath (append pathl (list hed)))
(parentnode (tree:find-node obj pathl))
(nodenum (tree:find-node obj newpath)))
;; Add the branch under lastnode if not found
(if (not nodenum)
(begin
(iup:attribute-set! obj (conc "ADDBRANCH" parentnode) hed)
;; ERROR? ADDING DATA TO PARENT, DONT WE WANT IT ON CREATED NODE?
(if userdata
(iup:attribute-set! obj (conc "USERDATA" parentnode) userdata))
(if (null? tal)
#t
;; reset to top
(loop (car nodelst)(cdr nodelst) 1 (list top))))
(if (null? tal) ;; if null here then this path has already been added
|
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
(take path node-depth)
path))
(newpath (append trimpath (list node-title))))
(if (>= currnode nodenum)
newpath
(loop (+ currnode 1)
newpath)))))
#|
(let* ((tb (iup:treebox
#:value 0
#:name "Runs"
#:expand "YES"
|
>
>
>
>
>
|
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
(take path node-depth)
path))
(newpath (append trimpath (list node-title))))
(if (>= currnode nodenum)
newpath
(loop (+ currnode 1)
newpath)))))
(define (tree:delete-node obj top node-path) ;; node-path is a list of strings
(let ((id (tree:find-node obj (cons top node-path))))
(print "Found node to remove " id " for path " top " " node-path)
(iup:attribute-set! obj (conc "DELNODE" id) "SELECTED")))
#|
(let* ((tb (iup:treebox
#:value 0
#:name "Runs"
#:expand "YES"
|