- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xo::tdom::Class
::xo::tdom::Class create ... \
[ -autoimport autoimport ]
Class Relations
::xotcl::Class create ::xo::tdom::Class \ -superclass ::xotcl::ClassMethods (to be applied on instances)
autoimport (setter)
incr_level (scripted)
# # Keep the nesting level of TdomClass instances during creation. # Use a global variable to assure cleanup in case of exceptions. # set var __tdom_level global $var if {[info exists $var]} { incr $var $amount } else { set $var 1 }unknown (scripted)
set configurecmds [lrange $args 0 end-1] set createcmd [lindex $args end] # # Keep a stack of nesting levels of ::xo::tdom Objects. # The stack is used for building automatically an ordered # composite of objects, used e.g. in recursive renderings. # [self class] instvar stack set level [:incr_level] # # Create a new instance of the current class and configure it. # #:log "tdom START $level [self], cmd='$configurecmds'" set me [:new -destroy_on_cleanup {*}$configurecmds] #:log "tdom CREATED $level $me ([$me info class])" # # If we are not on the topmost level, add the created object # to the parent ordered composite. # set stack($level) $me if {$level > 1} { set parent $stack([expr {$level - 1}]) #:log "tdom ADD $level $me to $parent ([$parent info class])" $parent add $me } # # search for autoimports: all commands are executed in the ... currently not needed # # set class [$me info class] # foreach cl [concat $class [$class info heritage]] { # :log "tdom EVAL $level ns=[namespace current] autoimport in $cl?[$cl exists autoimport]" # if {[$cl exists autoimport]} { # :log "tdom IMPO [$cl autoimport] into $me" # namespace eval ::xo::tmp [list namespace import -force [$cl autoimport]] # } # } # #:log "tdom CMDS $level [lsort [info commands ::xo::tmp::*]]" if {$createcmd ne ""} { # # perform the subcommand on the caller level to expand (like in tdom) # all specified variables in the caller's context # uplevel $createcmd } # # autorendering means that after creating an ordered composite, # the topmost element is automatically rendered. This makes # the ::xo::tdom classes behave more like plain tDOM commands. # #:log "tdom AUTO $level [$me autorender]" if {$level == 1 && [$me autorender]} { #:log "tdom RNDR $level $me render" $me render } #:log "tdom END $level [self] me=$me" set level [:incr_level -1] return $me
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables