Tk Library Source Code

Artifact [6ee6362523]
Login

Artifact 6ee63625233e97ec4c0d74ca501a6716e2cc6756:

Attachment "cvs_tree" to ticket [621331ffff] added by decosterjos 2002-10-10 20:55:35.
# ----------------------------------------------------------------------------
#  Command Tree::delete
# ----------------------------------------------------------------------------
proc Tree::delete { path args } {
    variable $path
    upvar 0  $path data

    set sel $data(selnodes)

    foreach lnodes $args {
        foreach node $lnodes {
            if { [string compare $node "root"] && [info exists data($node)] } {
                set parent [lindex $data($node) 0]
                set idx    [lsearch $data($parent) $node]
                set data($parent) [lreplace $data($parent) $idx $idx]
		set idx    [lsearch $sel $node]
		if { $idx >= 0 } {
		    set sel [lreplace $sel $idx $idx]
		}
                _subdelete $path [list $node]
            }
        }
    }

    set data(selnodes) {}
    eval selection $path set $sel
    _redraw_idle $path 3
}