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)
commit9b7ae9b850a798fd225278eb0425763298507a66 (patch)
tree9b03b5d994b774c45832fb52878c33130c72ef73 /doc/winfo.n
parent2f76a4817c1eef8461559d98dd4bb444939d8906 (diff)
downloadtk-9b7ae9b850a798fd225278eb0425763298507a66.zip
tk-9b7ae9b850a798fd225278eb0425763298507a66.tar.gz
tk-9b7ae9b850a798fd225278eb0425763298507a66.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,