summaryrefslogtreecommitdiffstats
path: root/doc/winfo.n
diff options
context:
space:
mode:
authordonal.k.fellows@manchester.ac.uk <dkf>2004-06-18 21:58:37 (GMT)
committerdonal.k.fellows@manchester.ac.uk <dkf>2004-06-18 21:58:37 (GMT)
commit26c4e31cb0895d314bc19f9edbde806583725104 (patch)
tree9b03b5d994b774c45832fb52878c33130c72ef73 /doc/winfo.n
parent9715e03f76d16555ceb975c4d44257f743a7cca8 (diff)
downloadtk-26c4e31cb0895d314bc19f9edbde806583725104.zip
tk-26c4e31cb0895d314bc19f9edbde806583725104.tar.gz
tk-26c4e31cb0895d314bc19f9edbde806583725104.tar.bz2
Added example
Diffstat (limited to 'doc/winfo.n')
-rw-r--r--doc/winfo.n14
1 files changed, 13 insertions, 1 deletions
diff --git a/doc/winfo.n b/doc/winfo.n
index 975c51a..324d6e3 100644
--- a/doc/winfo.n
+++ b/doc/winfo.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: winfo.n,v 1.4 2004/03/25 14:33:33 dkf Exp $
+'\" RCS: @(#) $Id: winfo.n,v 1.5 2004/06/18 22:31:18 dkf Exp $
'\"
.so man.macros
.TH winfo n 4.3 Tk "Tk Built-In Commands"
@@ -327,6 +327,18 @@ Returns a decimal string giving the y-coordinate, in \fIwindow\fR's
parent, of the
upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it
has no border).
+.SH EXAMPLE
+Print where the mouse pointer is and what window it is currently over:
+.CS
+lassign [\fBwinfo\fR pointerxy .] x y
+puts -nonewline "Mouse pointer at ($x,$y) which is "
+set win [\fBwinfo\fR containing $x $y]
+if {$win eq ""} {
+ puts "over no window"
+} else {
+ puts "over $win"
+}
+.CE
.SH KEYWORDS
atom, children, class, geometry, height, identifier, information, interpreters,