Index: openacs-4/packages/xotcl-core/tcl/20-Ordered-Composite-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/20-Ordered-Composite-procs.tcl,v diff -u -N -r1.17 -r1.18 --- openacs-4/packages/xotcl-core/tcl/20-Ordered-Composite-procs.tcl 18 Mar 2010 09:36:12 -0000 1.17 +++ openacs-4/packages/xotcl-core/tcl/20-Ordered-Composite-procs.tcl 28 Oct 2010 22:15:25 -0000 1.18 @@ -86,18 +86,30 @@ } else { set insert 0 } + # + [self class]::ChildManager instvar composite + # push the active composite + lappend composite [self] + set errorOccurred [catch {namespace eval [self] $cmds} errorMsg] + + # pop the last active composite + set composite [lrange $composite 0 end-1] + if {$insert} { Object instmixin delete [self class]::ChildManager } if {$errorOccurred} {error $errorMsg} } Class OrderedComposite::ChildManager -instproc init args { set r [next] - set parent [self callingobject] ;# not a true calling object (ns-eval), but XOTcl 1 honors it + #set parent [self callingobject] ;# not a true calling object (ns-eval), but XOTcl 1 honors it #set parent [my info parent] ;# is ok in XOTcl 2, since the namespace is honored correctly #set parent [uplevel 2 self] ;# should work everywhere #puts stderr "-- CONTAINS p=$parent, co=[self callingobject] n=[uplevel 2 self]" + # + # get the top-most composite context as parent + set parent [lindex [[self class] set composite] end] $parent lappend __children [self] my set __parent $parent #my __after_insert