summaryrefslogtreecommitdiffstats
path: root/library/demos/ixset
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2003-09-30 14:54:29 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2003-09-30 14:54:29 (GMT)
commit89cb52358e92bd6496cf8068147b904a689dd870 (patch)
treee0a362b7a1e36df8ae583f336d3235ec1b5e6688 /library/demos/ixset
parentaba06731f7bcc8bfdbee568d70e1fd8611f6dce4 (diff)
downloadtk-89cb52358e92bd6496cf8068147b904a689dd870.zip
tk-89cb52358e92bd6496cf8068147b904a689dd870.tar.gz
tk-89cb52358e92bd6496cf8068147b904a689dd870.tar.bz2
Added [package require] to demos. [FRQ 815118]
Diffstat (limited to 'library/demos/ixset')
-rw-r--r--library/demos/ixset68
1 files changed, 32 insertions, 36 deletions
diff --git a/library/demos/ixset b/library/demos/ixset
index 3ae2689..21a099f 100644
--- a/library/demos/ixset
+++ b/library/demos/ixset
@@ -9,7 +9,10 @@ exec wish "$0" ${1+"$@"}
# 91/11/23 : pda@masi.ibp.fr, jt@ratp.fr : design
# 92/08/01 : pda@masi.ibp.fr : cleaning
#
-# RCS: @(#) $Id: ixset,v 1.4 2001/11/05 10:13:53 dkf Exp $
+# RCS: @(#) $Id: ixset,v 1.5 2003/09/30 14:54:30 dkf Exp $
+
+package require Tcl 8.4
+package require Tk
#
# Button actions
@@ -55,38 +58,31 @@ proc readsettings {} {
set xfd [open "|xset q" r]
while {[gets $xfd line] > -1} {
- set kw [lindex $line 0]
-
- case $kw in {
- {auto}
- {
- set rpt [lindex $line 1]
- if {[expr "{$rpt} == {repeat:}"]} then {
- set kbdrep [lindex $line 2]
- set kbdcli [lindex $line 6]
- }
- }
- {bell}
- {
- set bellvol [lindex $line 2]
- set bellpit [lindex $line 5]
- set belldur [lindex $line 8]
- }
- {acceleration:}
- {
- set mouseacc [lindex $line 1]
- set mousethr [lindex $line 3]
- }
- {prefer}
- {
- set bla [lindex $line 2]
- set screenbla [expr "{$bla} == {yes} ? {blank} : {noblank}"]
- }
- {timeout:}
- {
- set screentim [lindex $line 1]
- set screencyc [lindex $line 3]
+ switch -- [lindex $line 0] {
+ auto {
+ set rpt [lindex $line 1]
+ if {$rpt eq "repeat:"} {
+ set kbdrep [lindex $line 2]
+ set kbdcli [lindex $line 6]
}
+ }
+ bell {
+ set bellvol [lindex $line 2]
+ set bellpit [lindex $line 5]
+ set belldur [lindex $line 8]
+ }
+ acceleration: {
+ set mouseacc [lindex $line 1]
+ set mousethr [lindex $line 3]
+ }
+ prefer {
+ set bla [lindex $line 2]
+ set screenbla [expr {$bla eq "yes" ? "blank" : "noblank"}]
+ }
+ timeout: {
+ set screentim [lindex $line 1]
+ set screencyc [lindex $line 3]
+ }
}
}
close $xfd
@@ -116,7 +112,7 @@ proc writesettings {} {
set bellpit [.bell.val.pit.entry get]
set belldur [.bell.val.dur.entry get]
- if {[expr "{$kbdrep} == {on}"]} then {
+ if {$kbdrep eq "on"} {
set kbdcli [.kbd.val.cli get]
} else {
set kbdcli "off"
@@ -152,7 +148,7 @@ proc dispsettings {} {
.bell.val.dur.entry delete 0 end
.bell.val.dur.entry insert 0 $belldur
- .kbd.val.onoff [expr "{$kbdrep} == {on} ? {select} : {deselect}"]
+ .kbd.val.onoff [expr {$kbdrep eq "on" ? "select" : "deselect"}]
.kbd.val.cli set $kbdcli
.mouse.hor.acc.entry delete 0 end
@@ -160,8 +156,8 @@ proc dispsettings {} {
.mouse.hor.thr.entry delete 0 end
.mouse.hor.thr.entry insert 0 $mousethr
- .screen.blank [expr "{$screenbla}=={blank} ? {select} : {deselect}"]
- .screen.pat [expr "{$screenbla}!={blank} ? {select} : {deselect}"]
+ .screen.blank [expr {$screenbla eq "blank" ? "select" : "deselect"}]
+ .screen.pat [expr {$screenbla ne "blank" ? "select" : "deselect"}]
.screen.tim.entry delete 0 end
.screen.tim.entry insert 0 $screentim
.screen.cyc.entry delete 0 end