summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authordkf <dkf@noemail.net>2004-05-23 20:56:37 (GMT)
committerdkf <dkf@noemail.net>2004-05-23 20:56:37 (GMT)
commite231f7da5be60d79946bb0633e7bfd2ba6eaf661 (patch)
treed6e41ff71ff2f92c7349b6a36a3dad714a113c37 /doc
parentab5e5085dea4593c25b50ed18fa47defbd6e191f (diff)
downloadtk-e231f7da5be60d79946bb0633e7bfd2ba6eaf661.zip
tk-e231f7da5be60d79946bb0633e7bfd2ba6eaf661.tar.gz
tk-e231f7da5be60d79946bb0633e7bfd2ba6eaf661.tar.bz2
Added bindtags example and split the changelog
FossilOrigin-Name: e780fc77f77e47bfab49b62b8dd69e66fca5ac68
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