summaryrefslogtreecommitdiffstats
path: root/library
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
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')
-rw-r--r--library/ttk/button.tcl6
-rw-r--r--library/ttk/combobox.tcl4
-rw-r--r--library/ttk/utils.tcl39
3 files changed, 37 insertions, 12 deletions
diff --git a/library/ttk/button.tcl b/library/ttk/button.tcl
index ccc1fb4..494a674 100644
--- a/library/ttk/button.tcl
+++ b/library/ttk/button.tcl
@@ -1,5 +1,5 @@
#
-# $Id: button.tcl,v 1.1 2006/10/31 01:42:26 hobbs Exp $
+# $Id: button.tcl,v 1.2 2006/11/27 06:53:55 jenglish Exp $
#
# Bindings for Buttons, Checkbuttons, and Radiobuttons.
#
@@ -36,8 +36,8 @@ bind TButton <Button1-Enter> \
# Checkbuttons and Radiobuttons have the same bindings as Buttons:
#
-ttk::CopyBindings TButton TCheckbutton
-ttk::CopyBindings TButton TRadiobutton
+ttk::copyBindings TButton TCheckbutton
+ttk::copyBindings TButton TRadiobutton
# ...plus a few more:
diff --git a/library/ttk/combobox.tcl b/library/ttk/combobox.tcl
index 7df9f61..6c7099c 100644
--- a/library/ttk/combobox.tcl
+++ b/library/ttk/combobox.tcl
@@ -1,5 +1,5 @@
#
-# $Id: combobox.tcl,v 1.1 2006/10/31 01:42:27 hobbs Exp $
+# $Id: combobox.tcl,v 1.2 2006/11/27 06:53:55 jenglish Exp $
#
# Ttk widget set: combobox bindings.
#
@@ -21,7 +21,7 @@ namespace eval ttk::combobox {
# Duplicate the Entry bindings, override if needed:
#
-ttk::CopyBindings TEntry TCombobox
+ttk::copyBindings TEntry TCombobox
bind TCombobox <KeyPress-Down> { ttk::combobox::Post %W }
bind TCombobox <KeyPress-Escape> { ttk::combobox::Unpost %W }
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]
}