summaryrefslogtreecommitdiffstats
path: root/library/demos/ixset
diff options
context:
space:
mode:
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