summaryrefslogtreecommitdiffstats
path: root/doc/grab.n
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-10-28 10:19:28 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-10-28 10:19:28 (GMT)
commit2bd85cbab370268321d9634c72bc7a66df1de397 (patch)
tree4510d45a04d9e2aca7a63a3473795ac8dd76d9c8 /doc/grab.n
parent5a56a6eaaa415bbd89c3b00a8a58ca629182842f (diff)
downloadtk-2bd85cbab370268321d9634c72bc7a66df1de397.zip
tk-2bd85cbab370268321d9634c72bc7a66df1de397.tar.gz
tk-2bd85cbab370268321d9634c72bc7a66df1de397.tar.bz2
Backport of documentation fixes
Diffstat (limited to 'doc/grab.n')
-rw-r--r--doc/grab.n18
1 files changed, 16 insertions, 2 deletions
diff --git a/doc/grab.n b/doc/grab.n
index 887ae66..e3ea0e6 100644
--- a/doc/grab.n
+++ b/doc/grab.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: grab.n,v 1.2 1998/09/14 18:22:56 stanton Exp $
+'\" RCS: @(#) $Id: grab.n,v 1.2.26.1 2004/10/28 10:19:29 dkf Exp $
'\"
.so man.macros
.TH grab n "" Tk "Tk Built-In Commands"
@@ -102,7 +102,11 @@ does nothing. Returns an empty string.
Returns \fBnone\fR if no grab is currently set on \fIwindow\fR,
\fBlocal\fR if a local grab is set on \fIwindow\fR, and
\fBglobal\fR if a global grab is set.
-
+.SH WARNING
+It is very easy to use global grabs to render a display completely
+unusable (e.g. by setting a grab on a widget which does not respond to
+events and not providing any mechanism for releasing the grab). Take
+\fIextreme\fR care when using them!
.SH BUGS
.PP
It took an incredibly complex and gross implementation to produce
@@ -117,6 +121,16 @@ If a single process is managing several different Tk applications,
only one of those applications can have a local grab for a given
display at any given time. If the applications are in different
processes, this restriction doesn't exist.
+.SH EXAMPLE
+Set a grab so that only one button may be clicked out of a group. The
+other buttons are unresponsive to the mouse until the middle button is
+clicked.
+.CS
+pack [button .b1 \-text "Click me! #1" \-command {destroy .b1}]
+pack [button .b2 \-text "Click me! #2" \-command {destroy .b2}]
+pack [button .b3 \-text "Click me! #3" \-command {destroy .b3}]
+\fBgrab\fR .b2
+.CE
.SH KEYWORDS
grab, keyboard events, pointer events, window