# To subscribers of the xforms list from Angus Leeming <angus.leeming@btopenworld.com> :
On Wednesday 09 April 2003 3:45 pm, Jean-Marc Lasgouttes wrote:
> Now, when I try to understand the second test, I am a bit lost. It
> seems to me that mx is a coordinate relative to the popup. So what
> sense does it make to compare it to m->x?
mx and my are the coordinates of the mouse pointer relative to the top left
corner of the dialog's Window.
PopUp::x,y are defined as /* origin relative to root */ which I suspect means
relative to the button that launched them.
Having said that, the relevant code is:
static FL_Coord extx, exty;
fl_showpup(int n) {
PopUP *m = menu_rec + n;
/* external coord is given relative to root */
if (!extpos)
fl_get_mouse(&extx, &exty, &kmask);
else if (extx < 0)
extx = -extx - m->w;
else if (exty < 0)
exty = -exty - m->h;
/* if parent is not root, need to find its geometry */
if (m->parent != fl_root)
fl_get_win_geometry(m->parent, &px, &py, &pw, &ph);
x = extx;
y = exty;
m->x = x;
m->y = y;
}
Does this help any?
Angus
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://world.std.com/~xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/
Development: http://savannah.nongnu.org/files/?group=xforms
This archive was generated by hypermail 2b29 : Wed Apr 09 2003 - 16:06:25 EDT