summaryrefslogtreecommitdiffstats
path: root/library/button.tcl
diff options
context:
space:
mode:
authorstanton <stanton>1999-04-16 01:51:06 (GMT)
committerstanton <stanton>1999-04-16 01:51:06 (GMT)
commit03656f44f81469f459031fa3a4a7b09c8bc77712 (patch)
tree31378e81bd58f8c726fc552d6b30cbf3ca07497b /library/button.tcl
parent404fc236f34304df53b7e44bc7971d786b87d453 (diff)
downloadtk-03656f44f81469f459031fa3a4a7b09c8bc77712.zip
tk-03656f44f81469f459031fa3a4a7b09c8bc77712.tar.gz
tk-03656f44f81469f459031fa3a4a7b09c8bc77712.tar.bz2
* Merged 8.1 branch into the main trunk
Diffstat (limited to 'library/button.tcl')
-rw-r--r--library/button.tcl70
1 files changed, 35 insertions, 35 deletions
diff --git a/library/button.tcl b/library/button.tcl
index 4214a8a..d70916a 100644
--- a/library/button.tcl
+++ b/library/button.tcl
@@ -4,7 +4,7 @@
# checkbutton, and radiobutton widgets and provides procedures
# that help in implementing those bindings.
#
-# RCS: @(#) $Id: button.tcl,v 1.3 1998/09/14 18:23:22 stanton Exp $
+# RCS: @(#) $Id: button.tcl,v 1.4 1999/04/16 01:51:26 stanton Exp $
#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
@@ -17,7 +17,7 @@
# The code below creates the default class bindings for buttons.
#-------------------------------------------------------------------------
-if {$tcl_platform(platform) == "macintosh"} {
+if {[string match "macintosh" $tcl_platform(platform)]} {
bind Radiobutton <Enter> {
tkButtonEnter %W
}
@@ -37,7 +37,7 @@ if {$tcl_platform(platform) == "macintosh"} {
tkButtonUp %W
}
}
-if {$tcl_platform(platform) == "windows"} {
+if {[string match "windows" $tcl_platform(platform)]} {
bind Checkbutton <equal> {
tkCheckRadioInvoke %W select
}
@@ -67,7 +67,7 @@ if {$tcl_platform(platform) == "windows"} {
tkCheckRadioEnter %W
}
}
-if {$tcl_platform(platform) == "unix"} {
+if {[string match "unix" $tcl_platform(platform)]} {
bind Checkbutton <Return> {
if {!$tk_strictMotif} {
tkCheckRadioInvoke %W
@@ -126,7 +126,7 @@ bind Radiobutton <Leave> {
tkButtonLeave %W
}
-if {$tcl_platform(platform) == "windows"} {
+if {[string match "windows" $tcl_platform(platform)]} {
#########################
# Windows implementation
@@ -142,8 +142,8 @@ if {$tcl_platform(platform) == "windows"} {
proc tkButtonEnter w {
global tkPriv
- if {[$w cget -state] != "disabled"} {
- if {$tkPriv(buttonWindow) == $w} {
+ if {[string compare [$w cget -state] "disabled"]} {
+ if {![string compare $tkPriv(buttonWindow) $w]} {
$w configure -state active -relief sunken
}
}
@@ -162,10 +162,10 @@ proc tkButtonEnter w {
proc tkButtonLeave w {
global tkPriv
- if {[$w cget -state] != "disabled"} {
+ if {[string compare [$w cget -state] "disabled"]} {
$w config -state normal
}
- if {$w == $tkPriv(buttonWindow)} {
+ if {![string compare $tkPriv(buttonWindow) $w]} {
$w configure -relief $tkPriv(relief)
}
set tkPriv(window) ""
@@ -182,8 +182,8 @@ proc tkButtonLeave w {
proc tkCheckRadioEnter w {
global tkPriv
- if {[$w cget -state] != "disabled"} {
- if {$tkPriv(buttonWindow) == $w} {
+ if {[string compare [$w cget -state] "disabled"]} {
+ if {![string compare $tkPriv(buttonWindow) $w]} {
$w configure -state active
}
}
@@ -202,7 +202,7 @@ proc tkCheckRadioEnter w {
proc tkButtonDown w {
global tkPriv
set tkPriv(relief) [lindex [$w conf -relief] 4]
- if {[$w cget -state] != "disabled"} {
+ if {[string compare [$w cget -state] "disabled"]} {
set tkPriv(buttonWindow) $w
$w config -relief sunken -state active
}
@@ -220,7 +220,7 @@ proc tkButtonDown w {
proc tkCheckRadioDown w {
global tkPriv
set tkPriv(relief) [lindex [$w conf -relief] 4]
- if {[$w cget -state] != "disabled"} {
+ if {[string compare [$w cget -state] "disabled"]} {
set tkPriv(buttonWindow) $w
$w config -state active
}
@@ -236,10 +236,10 @@ proc tkCheckRadioDown w {
proc tkButtonUp w {
global tkPriv
- if {$w == $tkPriv(buttonWindow)} {
+ if {![string compare $tkPriv(buttonWindow) $w]} {
set tkPriv(buttonWindow) ""
- if {($w == $tkPriv(window))
- && ([$w cget -state] != "disabled")} {
+ if {![string compare $tkPriv(window) $w]
+ && [string compare [$w cget -state] "disabled"]} {
$w config -relief $tkPriv(relief) -state normal
uplevel #0 [list $w invoke]
}
@@ -248,7 +248,7 @@ proc tkButtonUp w {
}
-if {$tcl_platform(platform) == "unix"} {
+if {[string match "unix" $tcl_platform(platform)]} {
#####################
# Unix implementation
@@ -264,9 +264,9 @@ if {$tcl_platform(platform) == "unix"} {
proc tkButtonEnter {w} {
global tkPriv
- if {[$w cget -state] != "disabled"} {
+ if {[string compare [$w cget -state] "disabled"]} {
$w config -state active
- if {$tkPriv(buttonWindow) == $w} {
+ if {![string compare $tkPriv(buttonWindow) $w]} {
$w configure -state active -relief sunken
}
}
@@ -285,10 +285,10 @@ proc tkButtonEnter {w} {
proc tkButtonLeave w {
global tkPriv
- if {[$w cget -state] != "disabled"} {
+ if {[string compare [$w cget -state] "disabled"]} {
$w config -state normal
}
- if {$w == $tkPriv(buttonWindow)} {
+ if {![string compare $tkPriv(buttonWindow) $w]} {
$w configure -relief $tkPriv(relief)
}
set tkPriv(window) ""
@@ -306,7 +306,7 @@ proc tkButtonLeave w {
proc tkButtonDown w {
global tkPriv
set tkPriv(relief) [lindex [$w config -relief] 4]
- if {[$w cget -state] != "disabled"} {
+ if {[string compare [$w cget -state] "disabled"]} {
set tkPriv(buttonWindow) $w
$w config -relief sunken
}
@@ -322,11 +322,11 @@ proc tkButtonDown w {
proc tkButtonUp w {
global tkPriv
- if {$w == $tkPriv(buttonWindow)} {
+ if {![string compare $w $tkPriv(buttonWindow)]} {
set tkPriv(buttonWindow) ""
$w config -relief $tkPriv(relief)
- if {($w == $tkPriv(window))
- && ([$w cget -state] != "disabled")} {
+ if {![string compare $w $tkPriv(window)]
+ && [string compare [$w cget -state] "disabled"]} {
uplevel #0 [list $w invoke]
}
}
@@ -334,7 +334,7 @@ proc tkButtonUp w {
}
-if {$tcl_platform(platform) == "macintosh"} {
+if {[string match "macintosh" $tcl_platform(platform)]} {
####################
# Mac implementation
@@ -350,8 +350,8 @@ if {$tcl_platform(platform) == "macintosh"} {
proc tkButtonEnter {w} {
global tkPriv
- if {[$w cget -state] != "disabled"} {
- if {$tkPriv(buttonWindow) == $w} {
+ if {[string compare [$w cget -state] "disabled"]} {
+ if {![string compare $w $tkPriv(buttonWindow)]} {
$w configure -state active
}
}
@@ -370,7 +370,7 @@ proc tkButtonEnter {w} {
proc tkButtonLeave w {
global tkPriv
- if {$w == $tkPriv(buttonWindow)} {
+ if {![string compare $w $tkPriv(buttonWindow)]} {
$w configure -state normal
}
set tkPriv(window) ""
@@ -387,7 +387,7 @@ proc tkButtonLeave w {
proc tkButtonDown w {
global tkPriv
- if {[$w cget -state] != "disabled"} {
+ if {[string compare [$w cget -state] "disabled"]} {
set tkPriv(buttonWindow) $w
$w config -state active
}
@@ -403,11 +403,11 @@ proc tkButtonDown w {
proc tkButtonUp w {
global tkPriv
- if {$w == $tkPriv(buttonWindow)} {
+ if {![string compare $w $tkPriv(buttonWindow)]} {
$w config -state normal
set tkPriv(buttonWindow) ""
- if {($w == $tkPriv(window))
- && ([$w cget -state] != "disabled")} {
+ if {![string compare $w $tkPriv(window)]
+ && [string compare [$w cget -state] "disabled"]} {
uplevel #0 [list $w invoke]
}
}
@@ -427,7 +427,7 @@ proc tkButtonUp w {
# w - The name of the widget.
proc tkButtonInvoke w {
- if {[$w cget -state] != "disabled"} {
+ if {[string compare [$w cget -state] "disabled"]} {
set oldRelief [$w cget -relief]
set oldState [$w cget -state]
$w configure -state active -relief sunken
@@ -449,7 +449,7 @@ proc tkButtonInvoke w {
# cmd - The subcommand to invoke (one of invoke, select, or deselect).
proc tkCheckRadioInvoke {w {cmd invoke}} {
- if {[$w cget -state] != "disabled"} {
+ if {[string compare [$w cget -state] "disabled"]} {
uplevel #0 [list $w $cmd]
}
}