[ This is experimental, and thus is not (yet) being submitted to
xemacs-patches. ]
Here's an experimental patch for 21.2 that provides a way of
getting the window pixel co-ordinates of a window point. I found that
the function, "current-pixel-column", already existed, and so I just
added the corresponding function, "current-pixel-row".
However, there's a big "gotcha" (issue) with these functions: they
both use the redisplay tables to determine the pixel position. This
basically means that a screen update/refresh must be done (e.g.,
"(sit-for 0)") before these functions will return correct values. For
newly-created frames, you have to do something like this instead:
;; idea stolen from set-mouse-position
(while (not (frame-visible-p frame)) (sleep-for .5))
Unfortunately, there doesn't seem to be a better way.
Jonathan Harris <jhar(a)tardis.ed.ac.uk> suggested the use of
"glyph_to_pixel_translation()". The problem with this is that you need
to provide the desired row and column, and there's no easy way to get
the row/column of a window point. Also, glyph_to_pixel_translation()
still depends on the redisplay tables being up-to-date. Because of all
this, I decided to simply extend "current-pixel-column".
Comments? I'll send a patch to xemacs-patches if I don't hear
anything.
--
Darryl Okahata
darrylo(a)soco.agilent.com
DISCLAIMER: this message is the author's personal opinion and does not
constitute the support, opinion, or policy of Agilent Technologies, or
of the little green men that have been following him all day.