summaryrefslogtreecommitdiffstats
path: root/library/ttk/utils.tcl
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2006-11-27 06:53:55 (GMT)
committerjenglish <jenglish@flightlab.com>2006-11-27 06:53:55 (GMT)
commitf712f4ec5ef0bcc07b9d89ea382dd50c02119ee6 (patch)
tree3306d90d76a3f92d63551f764257f107f5498d36 /library/ttk/utils.tcl
parentf9e2925711ddf6f1acc994cb233cf91c8bdb11b2 (diff)
downloadtk-f712f4ec5ef0bcc07b9d89ea382dd50c02119ee6.zip
tk-f712f4ec5ef0bcc07b9d89ea382dd50c02119ee6.tar.gz
tk-f712f4ec5ef0bcc07b9d89ea382dd50c02119ee6.tar.bz2
* generic/ttk/ttkWidget.c, generic/ttk/ttkPaned.c Fix for #1603506
* library/ttk/button.tcl, library/ttk/combobox.tcl, library/ttk/utils.tcl: Rename ttk::CopyBindings to ttk::copyBindings * generic/ttk/ttkTreeview.c, doc/ttk_treeview.n: -displaycolumns {} now means "no columns" instead of "all columns". Use -displaycolumns #all for "all columns" [Fixes #1547622].
Diffstat (limited to 'library/ttk/utils.tcl')
-rw-r--r--library/ttk/utils.tcl39
1 files changed, 32 insertions, 7 deletions
diff --git a/library/ttk/utils.tcl b/library/ttk/utils.tcl
index 11f85b9..8019303 100644
--- a/library/ttk/utils.tcl
+++ b/library/ttk/utils.tcl
@@ -1,7 +1,7 @@
#
-# $Id: utils.tcl,v 1.2 2006/11/07 03:45:28 jenglish Exp $
+# $Id: utils.tcl,v 1.3 2006/11/27 06:53:55 jenglish Exp $
#
-# Ttk widget set: utilities for widget implementations.
+# Utilities for widget implementations.
#
### Focus management.
@@ -17,6 +17,30 @@ 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.
+#
+proc ttk::traverseTo {w} {
+ set focus [focus]
+ if {$focus ne ""} {
+ event generate $focus <<TraverseOut>>
+ }
+ focus $w
+ event generate $w <<TraverseIn>>
+}
+
## ttk::clickToFocus $w --
# Utility routine, used in <ButtonPress-1> bindings --
# Assign keyboard focus to the specified widget if -takefocus is enabled.
@@ -58,15 +82,16 @@ proc ttk::takesFocus {w} {
return 0
}
-# ttk::focusFirst $w --
+## ttk::focusFirst $w --
# Return the first descendant of $w, in preorder traversal order,
# that can take keyboard focus, "" if none do.
#
# See also: tk_focusNext
#
+
proc ttk::focusFirst {w} {
- if {[ttk::takesFocus $w]} {
- return $w
+ if {[ttk::takesFocus $w]} {
+ return $w
}
foreach child [winfo children $w] {
if {[set c [ttk::focusFirst $child]] ne ""} {
@@ -222,10 +247,10 @@ proc ttk::CancelRepeat {} {
### Miscellaneous.
#
-## ttk::CopyBindings $from $to --
+## ttk::copyBindings $from $to --
# Utility routine; copies bindings from one bindtag onto another.
#
-proc ttk::CopyBindings {from to} {
+proc ttk::copyBindings {from to} {
foreach event [bind $from] {
bind $to $event [bind $from $event]
}