diff options
author | dkf <dkf@noemail.net> | 2004-06-21 21:19:40 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2004-06-21 21:19:40 (GMT) |
commit | 422e9516ac289fcd0b51666a9e3ca95a98c5d966 (patch) | |
tree | c98885b0d63433297618b12908079fa42faa3996 /doc | |
parent | df2fe250f476e03547b25e53e6fda0ed75f5ad16 (diff) | |
download | tk-422e9516ac289fcd0b51666a9e3ca95a98c5d966.zip tk-422e9516ac289fcd0b51666a9e3ca95a98c5d966.tar.gz tk-422e9516ac289fcd0b51666a9e3ca95a98c5d966.tar.bz2 |
Added example and warning about global grabs
FossilOrigin-Name: c759e94d2ccf82d4d1cf36b3dfc5f315d91bf148
Diffstat (limited to 'doc')
-rw-r--r-- | doc/grab.n | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -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.3 2004/06/21 21:19:41 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}] +grab .b2 +.CE .SH KEYWORDS grab, keyboard events, pointer events, window |