1 # -*-mode: tcl; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
3 # $Id: Private.tcl,v 1.3 2006-06-30 15:04:58 villate Exp $
5 ###### private.tcl ######
6 ############################################################
7 # Netmath Copyright (C) 1998 William F. Schelter #
8 # For distribution under GNU public License. See COPYING. #
9 ############################################################
11 # a private way of storing variables on a window by window
13 #mike FIXME: these stay in memory when the window is destroyed
15 proc makeLocal
{ win args
} {
17 uplevel 1 set $v \[oget
$win $v\]
21 proc linkLocal
{ win args
} {
23 uplevel 1 upvar #0 _WinInfo${win}\($v) $v
27 proc clearLocal
{ win
} {
29 # puts "clearing info for $win in [info level 1]"
30 catch { unset _WinInfo
$win }
34 proc oset
{ win var val
} {
36 set _WinInfo
[set win
]($var) $val
39 proc oarraySet
{ win vals
} {
41 array set _WinInfo
$win $vals
44 proc oloc
{ win var
} {
45 return _WinInfo
[set win
]($var)
49 return _WinInfo
[set win
]
52 proc oget
{ win var
} {
54 return [set _WinInfo
[set win
]($var)]
57 ## endsource private.tcl