[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: text mode menubar events get confused by left margin
From: |
Nick Roberts |
Subject: |
Re: text mode menubar events get confused by left margin |
Date: |
Wed, 4 Apr 2007 09:49:18 +1200 |
> 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