diff options
author | dgp <dgp@users.sourceforge.net> | 2001-08-01 16:21:11 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2001-08-01 16:21:11 (GMT) |
commit | 98ea3cb2214b51432f38f6ea50c1c429397281cc (patch) | |
tree | 38846cbe94cc8aac068898282ced4624f130770e /library/focus.tcl | |
parent | 7e9aececf720b6f0e20157366f8e977ad2378ddd (diff) | |
download | tk-98ea3cb2214b51432f38f6ea50c1c429397281cc.zip tk-98ea3cb2214b51432f38f6ea50c1c429397281cc.tar.gz tk-98ea3cb2214b51432f38f6ea50c1c429397281cc.tar.bz2 |
Merged changes from feature branch dgp-privates-into-namespace,
implementing TIP 44. All Tk commands and variables matching
tk[A-Z]* are now in the ::tk namespace.
Diffstat (limited to 'library/focus.tcl')
-rw-r--r-- | library/focus.tcl | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/library/focus.tcl b/library/focus.tcl index 9a03ea1..75bf410 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.8 2000/05/09 17:28:31 hobbs Exp $ +# RCS: @(#) $Id: focus.tcl,v 1.9 2001/08/01 16:21:11 dgp Exp $ # # Copyright (c) 1994-1995 Sun Microsystems, Inc. # @@ -11,7 +11,7 @@ # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# tk_focusNext -- +# ::tk_focusNext -- # This procedure returns the name of the next window after "w" in # "focus order" (the window that should receive the focus next if # Tab is typed in w). "Next" is defined by a pre-order search @@ -22,7 +22,7 @@ # Arguments: # w - Name of a window. -proc tk_focusNext w { +proc ::tk_focusNext w { set cur $w while {1} { @@ -57,13 +57,13 @@ proc tk_focusNext w { set children [winfo children $parent] set i [lsearch -exact $children $cur] } - if {[string equal $w $cur] || [tkFocusOK $cur]} { + if {[string equal $w $cur] || [tk::FocusOK $cur]} { return $cur } } } -# tk_focusPrev -- +# ::tk_focusPrev -- # This procedure returns the name of the previous window before "w" in # "focus order" (the window that should receive the focus next if # Shift-Tab is typed in w). "Next" is defined by a pre-order search @@ -74,7 +74,7 @@ proc tk_focusNext w { # Arguments: # w - Name of a window. -proc tk_focusPrev w { +proc ::tk_focusPrev w { set cur $w while {1} { @@ -108,13 +108,13 @@ proc tk_focusPrev w { set i [llength $children] } set cur $parent - if {[string equal $w $cur] || [tkFocusOK $cur]} { + if {[string equal $w $cur] || [tk::FocusOK $cur]} { return $cur } } } -# tkFocusOK -- +# ::tk::FocusOK -- # # This procedure is invoked to decide whether or not to focus on # a given window. It returns 1 if it's OK to focus on the window, @@ -128,7 +128,7 @@ proc tk_focusPrev w { # Arguments: # w - Name of a window. -proc tkFocusOK w { +proc ::tk::FocusOK w { set code [catch {$w cget -takefocus} value] if {($code == 0) && ($value != "")} { if {$value == 0} { @@ -152,7 +152,7 @@ proc tkFocusOK w { regexp Key|Focus "[bind $w] [bind [winfo class $w]]" } -# tk_focusFollowsMouse -- +# ::tk_focusFollowsMouse -- # # If this procedure is invoked, Tk will enter "focus-follows-mouse" # mode, where the focus is always on whatever window contains the @@ -162,13 +162,13 @@ proc tkFocusOK w { # Arguments: # None. -proc tk_focusFollowsMouse {} { +proc ::tk_focusFollowsMouse {} { set old [bind all <Enter>] set script { if {[string equal "%d" "NotifyAncestor"] \ || [string equal "%d" "NotifyNonlinear"] \ || [string equal "%d" "NotifyInferior"]} { - if {[tkFocusOK %W]} { + if {[tk::FocusOK %W]} { focus %W } } |