From 793640d6e4bdd2ebea229ae0c606d687d2690db9 Mon Sep 17 00:00:00 2001 From: Cyan Ogilvie Date: Wed, 16 Apr 2008 20:00:00 +0200 Subject: [PATCH] Added some debug output --- scripts/dcontrol.itk | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/scripts/dcontrol.itk b/scripts/dcontrol.itk index 3c62bdf..69b46d6 100644 --- a/scripts/dcontrol.itk +++ b/scripts/dcontrol.itk @@ -1,7 +1,7 @@ # vim: foldmarker=<<<,>>> class tlc::Dcontrol { - inherit tlc::Border + inherit tlc::Border tlc::Baselog constructor {args} {} @@ -20,16 +20,18 @@ class tlc::Dcontrol { } -body tlc::Dcontrol::constructor {args} { #<<<1 +body tlc::Dcontrol::constructor {args} { #<<< + set baselog_instancename $this + array set assoc {} - eval itk_initialize $args + itk_initialize {*}$args # pack propagate $w 0 } - -body tlc::Dcontrol::associate {key path} { #<<<1 +#>>> +body tlc::Dcontrol::associate {key path} { #<<< if {$path == ""} { array unset assoc $key return @@ -43,10 +45,11 @@ body tlc::Dcontrol::associate {key path} { #<<<1 } } - -body tlc::Dcontrol::select {key} { #<<<1 +#>>> +body tlc::Dcontrol::select {key} { #<<< if {$keynow == $key} return pack forget $pathnow + log debug "forgot ($pathnow)" if {![info exists assoc($key)]} { error "No path association for key $key" } @@ -57,17 +60,18 @@ body tlc::Dcontrol::select {key} { #<<<1 set pathnow $assoc($key) pack $pathnow -in $w -fill both -expand true + log debug "Selected ($key) ($pathnow)" set keynow $key } - -body tlc::Dcontrol::list_keys {} { #<<<1 +#>>> +body tlc::Dcontrol::list_keys {} { #<<< return [array get assoc] } - -body tlc::Dcontrol::exists {key} { #<<<1 +#>>> +body tlc::Dcontrol::exists {key} { #<<< return [info exists assoc($key)] } - +#>>> -- 2.11.4.GIT