unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David PONCE <david.ponce@wanadoo.fr>
Cc: emacs-devel@gnu.org
Subject: Re: `posn-at-point' and `posn-at-x-y' not in manual
Date: Fri,  4 Jun 2004 14:15:52 +0200 (CEST)	[thread overview]
Message-ID: <16878127.1086351352498.JavaMail.www@wwinf1002> (raw)

>>About the `posn-at-point' function, any idea on how to convert the
>>pixel coordinates it returns, which are relative to a window, into
>>coordinates relative to the selected frame, to display a tool tip at
>>point for example?
> 
> 
> window-inside-pixel-edges or window-pixel-edges ?

Of course!  Thanks!
As an example, here is an implementation of a `set-mouse-at-point'
function that seems to work very well :-)

(defun set-mouse-at-point ()
  "Move the mouse pointer to pixel position of point."
  (let* ((pos (posn-at-point))
         (x-y (posn-x-y pos))
         (wnd (posn-window pos))
         (frm (window-frame wnd))
         (edg (window-pixel-edges wnd)))
    (set-mouse-pixel-position
     frm
     (+ (car x-y) (car  edg) (frame-char-width frm))
     (+ (cdr x-y) (cadr edg) (/ (frame-char-height frm) 2)))
    ))

             reply	other threads:[~2004-06-04 12:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-04 12:15 David PONCE [this message]
2004-06-04 12:23 ` `posn-at-point' and `posn-at-x-y' not in manual Masatake YAMATO
2004-06-07 10:47 ` Kim F. Storm
  -- strict thread matches above, loose matches on Subject: below --
2004-06-07 10:14 David PONCE
2004-06-04 14:37 David PONCE
2004-06-04 16:53 ` Masatake YAMATO
2004-06-04 17:11   ` Masatake YAMATO
2004-06-04 11:56 David PONCE
2004-06-04 12:10 ` David Kastrup
2004-06-05 13:49 ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16878127.1086351352498.JavaMail.www@wwinf1002 \
    --to=david.ponce@wanadoo.fr \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).