diff options
author | dgp <dgp@users.sourceforge.net> | 2006-01-25 18:21:40 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2006-01-25 18:21:40 (GMT) |
commit | ee09dd0c7cfc65378fac95dd53067bcd72b390e9 (patch) | |
tree | 9b964605296b4f7dd7bd91a2baa6ebd8c0bf21bc /library/focus.tcl | |
parent | 2a147ca9e8cdff6b06499b16942dd0a9b8b92228 (diff) | |
download | tk-ee09dd0c7cfc65378fac95dd53067bcd72b390e9.zip tk-ee09dd0c7cfc65378fac95dd53067bcd72b390e9.tar.gz tk-ee09dd0c7cfc65378fac95dd53067bcd72b390e9.tar.bz2 |
* library/bgerror.tcl: Updates to use Tcl 8.4 features. [Patch 1237759] * library/button.tcl:
* library/choosedir.tcl:
* library/clrpick.tcl:
* library/comdlg.tcl:
* library/console.tcl:
* library/dialog.tcl:
* library/entry.tcl:
* library/focus.tcl:
* library/listbox.tcl:
* library/menu.tcl:
* library/msgbox.tcl:
* library/palette.tcl:
* library/panedwindow.tcl:
* library/safetk.tcl:
* library/scale.tcl:
* library/scrlbar.tcl:
* library/spinbox.tcl:
* library/tearoff.tcl:
* library/text.tcl:
* library/tk.tcl:
* library/tkfbox.tcl:
* library/xmfbox.tcl:
Diffstat (limited to 'library/focus.tcl')
-rw-r--r-- | library/focus.tcl | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/library/focus.tcl b/library/focus.tcl index 75bf410..88e8cd4 100644 --- a/library/focus.tcl +++ b/library/focus.tcl @@ -3,7 +3,7 @@ # This file defines several procedures for managing the input # focus. # -# RCS: @(#) $Id: focus.tcl,v 1.9 2001/08/01 16:21:11 dgp Exp $ +# RCS: @(#) $Id: focus.tcl,v 1.9.4.1 2006/01/25 18:21:41 dgp Exp $ # # Copyright (c) 1994-1995 Sun Microsystems, Inc. # @@ -38,7 +38,7 @@ proc ::tk_focusNext w { incr i if {$i < [llength $children]} { set cur [lindex $children $i] - if {[string equal [winfo toplevel $cur] $cur]} { + if {[winfo toplevel $cur] eq $cur} { continue } else { break @@ -50,14 +50,14 @@ proc ::tk_focusNext w { # look for its next sibling. set cur $parent - if {[string equal [winfo toplevel $cur] $cur]} { + if {[winfo toplevel $cur] eq $cur} { break } set parent [winfo parent $parent] set children [winfo children $parent] set i [lsearch -exact $children $cur] } - if {[string equal $w $cur] || [tk::FocusOK $cur]} { + if {$w eq $cur || [tk::FocusOK $cur]} { return $cur } } @@ -82,7 +82,7 @@ proc ::tk_focusPrev w { # among its siblings. Also, if the window is a top-level, # then reposition to just after the last child of the window. - if {[string equal [winfo toplevel $cur] $cur]} { + if {[winfo toplevel $cur] eq $cur} { set parent $cur set children [winfo children $cur] set i [llength $children] @@ -100,7 +100,7 @@ proc ::tk_focusPrev w { while {$i > 0} { incr i -1 set cur [lindex $children $i] - if {[string equal [winfo toplevel $cur] $cur]} { + if {[winfo toplevel $cur] eq $cur} { continue } set parent $cur @@ -108,7 +108,7 @@ proc ::tk_focusPrev w { set i [llength $children] } set cur $parent - if {[string equal $w $cur] || [tk::FocusOK $cur]} { + if {$w eq $cur || [tk::FocusOK $cur]} { return $cur } } @@ -130,14 +130,14 @@ proc ::tk_focusPrev w { proc ::tk::FocusOK w { set code [catch {$w cget -takefocus} value] - if {($code == 0) && ($value != "")} { + if {($code == 0) && ($value ne "")} { if {$value == 0} { return 0 } elseif {$value == 1} { return [winfo viewable $w] } else { set value [uplevel #0 $value [list $w]] - if {$value != ""} { + if {$value ne ""} { return $value } } @@ -146,7 +146,7 @@ proc ::tk::FocusOK w { return 0 } set code [catch {$w cget -state} value] - if {($code == 0) && [string equal $value "disabled"]} { + if {($code == 0) && $value eq "disabled"} { return 0 } regexp Key|Focus "[bind $w] [bind [winfo class $w]]" @@ -165,15 +165,15 @@ proc ::tk::FocusOK w { proc ::tk_focusFollowsMouse {} { set old [bind all <Enter>] set script { - if {[string equal "%d" "NotifyAncestor"] \ - || [string equal "%d" "NotifyNonlinear"] \ - || [string equal "%d" "NotifyInferior"]} { + if {"%d" eq "NotifyAncestor" \ + || "%d" eq "NotifyNonlinear" \ + || "%d" eq "NotifyInferior"} { if {[tk::FocusOK %W]} { focus %W } } } - if {[string compare $old ""]} { + if {$old ne ""} { bind all <Enter> "$old; $script" } else { bind all <Enter> $script |