summaryrefslogtreecommitdiffstats
path: root/library/ttk/utils.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'library/ttk/utils.tcl')
-rw-r--r--library/ttk/utils.tcl21
1 files changed, 8 insertions, 13 deletions
diff --git a/library/ttk/utils.tcl b/library/ttk/utils.tcl
index 8019303..1f21f26 100644
--- a/library/ttk/utils.tcl
+++ b/library/ttk/utils.tcl
@@ -1,5 +1,5 @@
#
-# $Id: utils.tcl,v 1.3 2006/11/27 06:53:55 jenglish Exp $
+# $Id: utils.tcl,v 1.4 2007/10/22 03:35:14 jenglish Exp $
#
# Utilities for widget implementations.
#
@@ -17,18 +17,6 @@ proc ttk::takefocus {w} {
expr {[$w instate !disabled] && [winfo viewable $w]}
}
-# ttk::traverseTo $w --
-# Set the keyboard focus to the specified window.
-#
-proc ttk::traverseTo {w} {
- set focus [focus]
- if {$focus ne ""} {
- event generate $focus <<TraverseOut>>
- }
- focus $w
- event generate $w <<TraverseIn>>
-}
-
## ttk::traverseTo $w --
# Set the keyboard focus to the specified window.
#
@@ -127,6 +115,13 @@ namespace eval ttk {
proc ttk::SaveGrab {w} {
variable Grab
+ if {[info exists Grab($w)]} {
+ # $w is already on the grab stack.
+ # This should not happen, but bail out in case it does anyway:
+ #
+ return
+ }
+
set restoreGrab [set restoreFocus ""]
set grabbed [grab current $w]