summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-05-23 20:56:37 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-05-23 20:56:37 (GMT)
commit277dae22116724e1b69a6af79542fa48e1b674e3 (patch)
treed6e41ff71ff2f92c7349b6a36a3dad714a113c37 /doc
parent2c8194bb02f9bd362baed55ad54f9284ec74aa9e (diff)
downloadtk-277dae22116724e1b69a6af79542fa48e1b674e3.zip
tk-277dae22116724e1b69a6af79542fa48e1b674e3.tar.gz
tk-277dae22116724e1b69a6af79542fa48e1b674e3.tar.bz2
Added bindtags example and split the changelog
Diffstat (limited to 'doc')
-rw-r--r--doc/bindtags.n25
1 files changed, 23 insertions, 2 deletions
diff --git a/doc/bindtags.n b/doc/bindtags.n
index 7314dc3..5f54b3d 100644
--- a/doc/bindtags.n
+++ b/doc/bindtags.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: bindtags.n,v 1.2 1998/09/14 18:22:54 stanton Exp $
+'\" RCS: @(#) $Id: bindtags.n,v 1.3 2004/05/23 20:56:55 dkf Exp $
'\"
.so man.macros
.TH bindtags n 4.0 Tk "Tk Built-In Commands"
@@ -73,9 +73,30 @@ This means that the default widget bindings for buttons, which are
associated with the \fBButton\fR tag, will no longer apply to \fB.b\fR,
but any bindings associated with \fBTrickyButton\fR (perhaps some
new button behavior) will apply.
+.SH EXAMPLE
+If you have a set of nested \fBframe\fR widgets and you want events
+sent to a \fBbutton\fR widget to also be delivered to all the widgets
+up to the current \fBtoplevel\fR (in contrast to Tk's default
+behavior, where events are not delivered to those intermediate
+windows) to make it easier to have accelerators that are only active
+for part of a window, you could use a helper procedure like this to
+help set things up:
+.CS
+proc setupBindtagsForTreeDelivery {widget} {
+ set tags [list $widget [winfo class $widget]]
+ set w $widget
+ set t [winfo toplevel $w]
+ while {$w ne $t} {
+ set w [winfo parent $w]
+ lappend tags $w
+ }
+ lappend tags all
+ bindtags $widget $tags
+}
+.CE
.SH "SEE ALSO"
-bind
+bind(n)
.SH KEYWORDS
binding, event, tag