From: Nick Roberts <nickrob@snap.net.nz>
To: emacs-devel@gnu.org
Subject: Re: text mode menubar events get confused by left margin
Date: Wed, 4 Apr 2007 09:49:18 +1200 [thread overview]
Message-ID: <17938.52190.876889.424365@farnswood.snap.net.nz> (raw)
In-Reply-To: <17938.11030.644551.51492@farnswood.snap.net.nz>
> The margin is two characters wide. If I click on the first four characters
> I get:
>
> 1 (mouse-1 (nil menu-bar (0 . 0) 1541858 nil 1 (2 . 0) nil (0 . 0) (0 . 1)))
> 2 (mouse-1 (nil menu-bar (1 . 0) 1551105 nil 1 (3 . 0) nil (1 . 0) (0 . 1)))
> 3 (mouse-1 (nil menu-bar (0 . 0) 1560616 nil 1 (0 . 0) nil (0 . 0) (1 . 0)))
> 4 (mouse-1 (nil menu-bar (1 . 0) 1567674 nil 2 (1 . 0) nil (0 . 0) (1 . 0)))
>
> I can't make sense of this. I feel that I should be able to add two numbers
> to get the number on the left.
Sorry, this was due to my misunderstanding of posn-at-x-y.
On a related note, the doc string for this function says:
Return position information for pixel coordinates x and y.
^^^^^
It accepts character co-ordinates for a text only terminal.
By default, x and y are relative to text area of the selected window.
Optional third arg frame-or-window non-nil specifies frame or window.
If optional fourth arg whole is non-nil, x is relative to the left
edge of the window.
The return value is similar to a mouse click position:
(WINDOW AREA-OR-POS (x . y) TIMESTAMP OBJECT POS (COL . ROW)
IMAGE (DX . DY) (WIDTH . HEIGHT))
The `posn-' functions access elements of such lists.
The elisp manual (click events node) doesn't say what WIDTH or HEIGHT are
(glyph size on a graphical display?)
STRING and STRING-POS could be indented in the list in that node as they are
subcomponents of OBJECT. X,Y are character co-ordinates on a text only
terminal.
--
Nick http://www.inet.net.nz/~nickrob
prev parent reply other threads:[~2007-04-03 21:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-03 10:23 text mode menubar events get confused by left margin Nick Roberts
2007-04-03 21:49 ` Nick Roberts [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=17938.52190.876889.424365@farnswood.snap.net.nz \
--to=nickrob@snap.net.nz \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.