From 4a4b32ee7dcadb961f7d0feea109a61c92306e47 Mon Sep 17 00:00:00 2001 From: "N.N." Date: Wed, 25 Feb 2004 10:54:43 +0000 Subject: widget tracing backward compatible to tcl8.3 svn path=/trunk/externals/miXed/; revision=1359 --- test/toxy/default.wid | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'test/toxy/default.wid') diff --git a/test/toxy/default.wid b/test/toxy/default.wid index f3f549f..5553c92 100644 --- a/test/toxy/default.wid +++ b/test/toxy/default.wid @@ -29,10 +29,18 @@ proc ::toxy::itemsettrace {op path target varname} { error $err } } else { - trace add variable $res write "::toxy::itembindtrace $varname" + if {[info tclversion] < 8.4} { + trace variable $res w "::toxy::itembindtrace $varname" + } else { + trace add variable $res write "::toxy::itembindtrace $varname" + } } if {![info exists $varname.last]} { set $varname.last "" } - trace add variable $varname write "::toxy::itemdotrace $target" + if {[info tclversion] < 8.4} { + trace variable $varname w "::toxy::itemdotrace $target" + } else { + trace add variable $varname write "::toxy::itemdotrace $target" + } return } else { return 0 } } @@ -45,8 +53,12 @@ proc ::toxy::itemremovetrace {op path varname} { error $err } } elseif {$res != ""} { - catch { trace remove variable \ - $res write "::toxy::itembindtrace $varname" } + if {[info tclversion] < 8.4} { + catch { trace vdelete $res w "::toxy::itembindtrace $varname" } + } else { + catch { trace remove variable \ + $res write "::toxy::itembindtrace $varname" } + } } } } @@ -54,7 +66,11 @@ proc ::toxy::itemremovetrace {op path varname} { proc ::toxy::itemdestroy {path varname} { ::toxy::itemremovetrace -variable $path $varname.var ::toxy::itemremovetrace -textvariable $path $varname.txt - unset -nocomplain $varname.last $varname.var $varname.txt $varname + if {[info tclversion] < 8.4} { + catch { unset $varname.last $varname.var $varname.txt $varname } + } else { + unset -nocomplain $varname.last $varname.var $varname.txt $varname + } catch {destroy $path} } -- cgit v1.2.1