diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2005-07-25 09:05:59 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2005-07-25 09:05:59 (GMT) |
commit | 941ca458347a9eb90fce2843303fd7b9904b23c7 (patch) | |
tree | 500381c93622d097f72623503a4192b8a2313845 /library/tearoff.tcl | |
parent | 433e6f11f29adebca17a836a493470c3ee686daf (diff) | |
download | tk-941ca458347a9eb90fce2843303fd7b9904b23c7.zip tk-941ca458347a9eb90fce2843303fd7b9904b23c7.tar.gz tk-941ca458347a9eb90fce2843303fd7b9904b23c7.tar.bz2 |
Apply some of the changes suggested in [Patch 1237759]
Diffstat (limited to 'library/tearoff.tcl')
-rw-r--r-- | library/tearoff.tcl | 18 |
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} { |