]> git.zerfleddert.de Git - micropolis/blame - src/tk/library/demos/showVars.tcl
only swap bytes in mini map when needed
[micropolis] / src / tk / library / demos / showVars.tcl
CommitLineData
6a5fa4e0
MG
1# showVars w var var var ...
2#
3# Create a top-level window that displays a bunch of global variable values
4# and keeps the display up-to-date even when the variables change value
5#
6# Arguments:
7# w - Name to use for new top-level window.
8# var - Name of variable to monitor.
9
10proc showVars {w args} {
11 catch {destroy $w}
12 toplevel $w
13 wm title $w "Variable values"
14 label $w.title -text "Variable values:" -width 20 -anchor center \
15 -font -Adobe-helvetica-medium-r-normal--*-180*
16 pack append $w $w.title {top fillx}
17 foreach i $args {
18 frame $w.$i
19 label $w.$i.name -text "$i: "
20 label $w.$i.value -textvar $i
21 pack append $w.$i $w.$i.name left $w.$i.value left
22 pack append $w $w.$i {top frame w}
23 }
24 button $w.ok -text OK -command "destroy $w"
25 pack append $w $w.ok {bottom pady 2}
26}
Impressum, Datenschutz