summaryrefslogtreecommitdiffstats
path: root/library/tearoff.tcl
diff options
context:
space:
mode:
authordonal.k.fellows@manchester.ac.uk <dkf>2005-07-25 09:05:59 (GMT)
committerdonal.k.fellows@manchester.ac.uk <dkf>2005-07-25 09:05:59 (GMT)
commit90c86de9813e35e067d112ca4bfbc7dc09f091d8 (patch)
tree500381c93622d097f72623503a4192b8a2313845 /library/tearoff.tcl
parent8e00adc98db50bfdba501ec1dc769ba443e17156 (diff)
downloadtk-90c86de9813e35e067d112ca4bfbc7dc09f091d8.zip
tk-90c86de9813e35e067d112ca4bfbc7dc09f091d8.tar.gz
tk-90c86de9813e35e067d112ca4bfbc7dc09f091d8.tar.bz2
Apply some of the changes suggested in [Patch 1237759]
Diffstat (limited to 'library/tearoff.tcl')
-rw-r--r--library/tearoff.tcl18
1 files changed, 9 insertions, 9 deletions
diff --git a/library/tearoff.tcl b/library/tearoff.tcl
index f8b6856..ae74389 100644
--- a/library/tearoff.tcl
+++ b/library/tearoff.tcl
@@ -2,7 +2,7 @@
#
# This file contains procedures that implement tear-off menus.
#
-# RCS: @(#) $Id: tearoff.tcl,v 1.9 2004/03/17 18:15:45 das Exp $
+# RCS: @(#) $Id: tearoff.tcl,v 1.10 2005/07/25 09:06:00 dkf Exp $
#
# Copyright (c) 1994 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
@@ -44,11 +44,11 @@ proc ::tk::TearOffMenu {w {x 0} {y 0}} {
}
set parent [winfo parent $w]
- while {[string compare [winfo toplevel $parent] $parent] \
- || [string equal [winfo class $parent] "Menu"]} {
+ while {[winfo toplevel $parent] ne $parent \
+ || [winfo class $parent] eq "Menu"} {
set parent [winfo parent $parent]
}
- if {[string equal $parent "."]} {
+ if {$parent eq "."} {
set parent ""
}
for {set i 1} 1 {incr i} {
@@ -65,10 +65,10 @@ proc ::tk::TearOffMenu {w {x 0} {y 0}} {
# entry. If it's a menubutton then use its text.
set parent [winfo parent $w]
- if {[string compare [$menu cget -title] ""]} {
+ if {[$menu cget -title] ne ""} {
wm title $menu [$menu cget -title]
} else {
- switch [winfo class $parent] {
+ switch -- [winfo class $parent] {
Menubutton {
wm title $menu [$parent cget -text]
}
@@ -96,7 +96,7 @@ proc ::tk::TearOffMenu {w {x 0} {y 0}} {
# now.
set cmd [$w cget -tearoffcommand]
- if {[string compare $cmd ""]} {
+ if {$cmd ne ""} {
uplevel #0 $cmd [list $w $menu]
}
return $menu
@@ -118,14 +118,14 @@ proc ::tk::MenuDup {src dst type} {
if {[llength $option] == 2} {
continue
}
- if {[string equal [lindex $option 0] "-type"]} {
+ if {[lindex $option 0] eq "-type"} {
continue
}
lappend cmd [lindex $option 0] [lindex $option 4]
}
eval $cmd
set last [$src index last]
- if {[string equal $last "none"]} {
+ if {$last eq "none"} {
return
}
for {set i [$src cget -tearoff]} {$i <= $last} {incr i} {