| 1 |
# Copyright (c) 1990-1993 The Regents of the University of California. |
| 2 |
# Copyright (c) 1994-1996 Sun Microsystems, Inc. |
| 3 |
# See the file "license.terms" for information on usage and redistribution |
| 4 |
# of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| 5 |
# |
| 6 |
# |
| 7 |
|
| 8 |
=head1 NAME |
| 9 |
|
| 10 |
Tk_CoordsToWindow - Find window containing a point |
| 11 |
|
| 12 |
=for category C Programming |
| 13 |
|
| 14 |
=head1 SYNOPSIS |
| 15 |
|
| 16 |
B<#include E<lt>tk.hE<gt>> |
| 17 |
|
| 18 |
Tk_Window |
| 19 |
B<Tk_CoordsToWindow>(I<rootX, rootY, tkwin>) |
| 20 |
|
| 21 |
=head1 ARGUMENTS |
| 22 |
|
| 23 |
=over 4 |
| 24 |
|
| 25 |
=item int rootX (in) |
| 26 |
|
| 27 |
X-coordinate (in root window coordinates). |
| 28 |
|
| 29 |
=item int rootY (in) |
| 30 |
|
| 31 |
Y-coordinate (in root window coordinates). |
| 32 |
|
| 33 |
=item Tk_Window tkwin (in) |
| 34 |
|
| 35 |
Token for window that identifies application. |
| 36 |
|
| 37 |
=back |
| 38 |
|
| 39 |
=head1 DESCRIPTION |
| 40 |
|
| 41 |
B<Tk_CoordsToWindow> locates the window that contains a given point. |
| 42 |
The point is specified in root coordinates with I<rootX> and |
| 43 |
I<rootY> (if a virtual-root window manager is in use then |
| 44 |
I<rootX> and I<rootY> are in the coordinate system of the |
| 45 |
virtual root window). |
| 46 |
The return value from the procedure is a token for the window that |
| 47 |
contains the given point. |
| 48 |
If the point is not in any window, or if the containing window |
| 49 |
is not in the same application as I<tkwin>, then NULL is |
| 50 |
returned. |
| 51 |
|
| 52 |
The containing window is decided using the same rules that determine |
| 53 |
which window contains the mouse cursor: if a parent and a child both |
| 54 |
contain the point then the child gets preference, and if two siblings |
| 55 |
both contain the point then the highest one in the stacking order |
| 56 |
(i.e. the one that's visible on the screen) gets preference. |
| 57 |
|
| 58 |
=head1 KEYWORDS |
| 59 |
|
| 60 |
containing, coordinates, root window |