Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Pixel position of point.

0 views
Skip to first unread message

Paul Kinnucan

unread,
Mar 15, 2001, 2:38:23 PM3/15/01
to
How do I get the (x, y) coordinates of point? I need the pixel coordinates
because I need to create a simulated mouse button down event at point (via
make-event). I need to create the simulated mouse event to pass to imenu to
get it to popup a menu at point. I've searched the Lisp reference manual and
apropos, looking for some function or combination of functions that would
get me the desired screen coordinates of point. The closest I can find is
current-pixel-column, which returns the x coordinate of a specified position
in the buffer. You would think there would be a corresponding
current-pixel-line, but there is not. Nor is there the even more obvious:
current-pixel-position.

- Paul


Amit Patel

unread,
Mar 17, 2001, 3:23:54 PM3/17/01
to
"Paul Kinnucan" <pa...@mathworks.com> writes:

Hm, I don't have an answer to your question, but I have a cheesy
idea for a workaround: you may be able to grab the mouse position
with (mouse-pixel-position), then use (set-mouse-position) to move the
mouse to your point, grab the (mouse-pixel-position), then set the
mouse back to the original pixel position. This may be annoying if
you do this while the mouse pointer is being moved around. :-(

- Amit

--
Amit J Patel, Computer Science Department, Stanford University
http://www-cs-students.stanford.edu/~amitp/
``Parkinson's Other Law: Perfection is achieved only
at the point of collapse.''

0 new messages