Tk Library Source Code

Artifact [286f4341d3]
Login

Artifact 286f4341d352dbadd9a849d29059710dbf4f3451:

Attachment "tree-tcl.patch" to ticket [3106208fff] added by andreas_kupries 2010-12-15 00:05:15.
Index: tree.tcl
===================================================================
RCS file: /cvsroot/tcllib/bwidget/tree.tcl,v
retrieving revision 1.60.2.2
diff -w -u -r1.60.2.2 tree.tcl
--- tree.tcl	10 Nov 2010 07:56:53 -0000	1.60.2.2
+++ tree.tcl	13 Dec 2010 22:44:07 -0000
@@ -350,7 +350,7 @@
             _redraw_idle $path 3
         } else {
             # ...and closed -> redraw cross
-            lappend data(upd,nodes) $parent 8
+	    MergeFlag $path $parent 8
             _redraw_idle $path 2
         }
     }
@@ -400,6 +400,17 @@
 	}
 
 	if { $data(upd,level) < 3 && $flag } {
+	    MergeFlag $path $node $flag
+            _redraw_idle $path 2
+        }
+    }
+    return $result
+}
+
+proc Tree::MergeFlag { path node flag } {
+    variable $path
+    upvar 0  $path data
+
             # data(upd,nodes) is a key-val list: emulate a dict by an array
             array set n $data(upd,nodes)
             if {![info exists n($node)]} {
@@ -408,13 +419,9 @@
                 set n($node) [expr {$n($node) | $flag}]
                 set data(upd,nodes) [array get n]
             }
-            _redraw_idle $path 2
-        }
-    }
-    return $result
+    return
 }
 
-
 # ----------------------------------------------------------------------------
 #  Command Tree::itemcget
 # ----------------------------------------------------------------------------