summaryrefslogtreecommitdiffstats
path: root/doc/bind.n
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2017-09-16 08:23:51 (GMT)
committerfvogel <fvogelnew1@free.fr>2017-09-16 08:23:51 (GMT)
commit97bfb936a86ce9a127f447090f15b7b9f3b518bd (patch)
treea07ef296f333a500772ac136654297bb9964013b /doc/bind.n
parente2307279e7ebd4336c8b09fe1bbd97df23e0e4d4 (diff)
parent3f3e4eb1265437de62525fe9e825b3e90ab3d81d (diff)
downloadtk-97bfb936a86ce9a127f447090f15b7b9f3b518bd.zip
tk-97bfb936a86ce9a127f447090f15b7b9f3b518bd.tar.gz
tk-97bfb936a86ce9a127f447090f15b7b9f3b518bd.tar.bz2
Fix [d0c55bd78a]: inaccurate documentation for continue/break/ok in binding scripts. Thanks to Brad Lanam.
Diffstat (limited to 'doc/bind.n')
-rw-r--r--doc/bind.n24
1 files changed, 17 insertions, 7 deletions
diff --git a/doc/bind.n b/doc/bind.n
index becc08b..009fd08 100644
--- a/doc/bind.n
+++ b/doc/bind.n
@@ -19,9 +19,10 @@ bind \- Arrange for X events to invoke Tcl scripts
.PP
The \fBbind\fR command associates Tcl scripts with X events.
If all three arguments are specified, \fBbind\fR will
-arrange for \fIscript\fR (a Tcl script) to be evaluated whenever
-the event(s) given by \fIsequence\fR occur in the window(s)
-identified by \fItag\fR.
+arrange for \fIscript\fR (a Tcl script called the
+.QW "binding script")
+to be evaluated whenever the event(s) given by \fIsequence\fR
+occur in the window(s) identified by \fItag\fR.
If \fIscript\fR is prefixed with a
.QW + ,
then it is appended to
@@ -387,7 +388,8 @@ For example, \fB<Control\-comma>\fR is equivalent to
\fB<Control\-KeyPress\-comma>\fR.
.SH "BINDING SCRIPTS AND SUBSTITUTIONS"
.PP
-The \fIscript\fR argument to \fBbind\fR is a Tcl script,
+The \fIscript\fR argument to \fBbind\fR is a Tcl script, called the
+.QW "binding script",
which will be executed whenever the given event sequence occurs.
\fICommand\fR will be executed in the same interpreter that the
\fBbind\fR command was executed in, and it will run at global
@@ -606,13 +608,21 @@ the window.
.PP
The \fBcontinue\fR and \fBbreak\fR commands may be used inside a
binding script to control the processing of matching scripts.
-If \fBcontinue\fR is invoked, then the current binding script
-is terminated but Tk will continue processing binding scripts
-associated with other \fItag\fR's.
+If \fBcontinue\fR is invoked within a binding script, then this
+binding script, including all other
+.QW +
+appended scripts, is terminated but Tk will continue processing
+binding scripts associated with other \fItag\fR's.
If the \fBbreak\fR command is invoked within a binding script,
then that script terminates and no other scripts will be invoked
for the event.
.PP
+Within a script called from the binding script, \fBreturn\fR
+\fB-code ok\fR may be used to continue processing (including
+.QW +
+appended scripts), or \fBreturn\fR \fB-code break\fR may be used to
+stop processing all other binding scripts.
+.PP
If more than one binding matches a particular event and they
have the same \fItag\fR, then the most specific binding
is chosen and its script is evaluated.