unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Cursor position in pixels
@ 2005-03-04 18:18 PT
  2005-03-05 11:01 ` Eli Zaretskii
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: PT @ 2005-03-04 18:18 UTC (permalink / raw)


I plan to implement emacs support for a language and want to display  
suggestions for the user in a pop up frame. For example, the user starts  
to type the name of a function and if he hesitates a small frame appears  
in the screen above the line the cursor is in showing possible completions.

In order to position the popup frame correctly I need to know the position  
of the cursor in pixels relative to the top/left corner of the current  
Emacs frame. I couldn't find anything like that in the documentation. Is  
it possible?

Of course, I can show the completions in an other window in the same frame  
(pop-to-buffer), but a small temporary popup frame above the cursor would  
be nicer.

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Cursor position in pixels
  2005-03-04 18:18 Cursor position in pixels PT
@ 2005-03-05 11:01 ` Eli Zaretskii
       [not found] ` <mailman.2686.1110021568.32256.help-gnu-emacs@gnu.org>
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2005-03-05 11:01 UTC (permalink / raw)


> From: PT <mailshield.gg@mailnull.com>
> Date: Fri, 04 Mar 2005 19:18:01 +0100
> 
> I plan to implement emacs support for a language and want to display  
> suggestions for the user in a pop up frame. For example, the user starts  
> to type the name of a function and if he hesitates a small frame appears  
> in the screen above the line the cursor is in showing possible completions.
> 
> In order to position the popup frame correctly I need to know the position  
> of the cursor in pixels relative to the top/left corner of the current  
> Emacs frame. I couldn't find anything like that in the documentation. Is  
> it possible?

Do the functions frame-char-width and frame-char-height help you do
what you want?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Cursor position in pixels
       [not found] ` <mailman.2686.1110021568.32256.help-gnu-emacs@gnu.org>
@ 2005-03-05 17:45   ` PT
  0 siblings, 0 replies; 7+ messages in thread
From: PT @ 2005-03-05 17:45 UTC (permalink / raw)


On Sat, 05 Mar 2005 13:01:39 +0200, Eli Zaretskii <eliz@gnu.org> wrote:
>
> Do the functions frame-char-width and frame-char-height help you do
> what you want?

They seem promising. Thanks!

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Cursor position in pixels
  2005-03-04 18:18 Cursor position in pixels PT
  2005-03-05 11:01 ` Eli Zaretskii
       [not found] ` <mailman.2686.1110021568.32256.help-gnu-emacs@gnu.org>
@ 2005-03-05 21:35 ` Stefan Monnier
  2005-03-09 18:19   ` PT
  2005-03-14 15:46 ` Eric Ludlam
  3 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2005-03-05 21:35 UTC (permalink / raw)


> In order to position the popup frame correctly I need to know the position
> of the cursor in pixels relative to the top/left corner of the current
> Emacs frame. I couldn't find anything like that in the documentation. Is
> it possible?

posn-at-point gives you that information, but it's only available in
Emacs-CVS.


        Stefan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Cursor position in pixels
  2005-03-05 21:35 ` Stefan Monnier
@ 2005-03-09 18:19   ` PT
  0 siblings, 0 replies; 7+ messages in thread
From: PT @ 2005-03-09 18:19 UTC (permalink / raw)


On Sat, 05 Mar 2005 16:35:53 -0500, Stefan Monnier  
<monnier@iro.umontreal.ca> wrote:

>> In order to position the popup frame correctly I need to know the  
>> position
>> of the cursor in pixels relative to the top/left corner of the current
>> Emacs frame. I couldn't find anything like that in the documentation. Is
>> it possible?
>
> posn-at-point gives you that information, but it's only available in
> Emacs-CVS.

Currently, I use set/mouse-pixel-position for determining the position of  
the cursor.
It seems it also takes the fringe into account as a column.

(set-mouse-position (selected-frame) 0 0) moves the mouse cursor to the  
first line in the fringe column.

I don't really know if it's intentional or a bug. Does posn-at-point do  
the same?


-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Cursor position in pixels
  2005-03-04 18:18 Cursor position in pixels PT
                   ` (2 preceding siblings ...)
  2005-03-05 21:35 ` Stefan Monnier
@ 2005-03-14 15:46 ` Eric Ludlam
  2005-03-16 15:15   ` PT
  3 siblings, 1 reply; 7+ messages in thread
From: Eric Ludlam @ 2005-03-14 15:46 UTC (permalink / raw)


>>> PT <mailshield.gg@mailnull.com> seems to think that:
>I plan to implement emacs support for a language and want to display
>suggestions for the user in a pop up frame. For example, the user
>starts  to type the name of a function and if he hesitates a small
>frame appears  in the screen above the line the cursor is in showing
>possible completions.
>
>In order to position the popup frame correctly I need to know the
>position  of the cursor in pixels relative to the top/left corner of
>the current  Emacs frame. I couldn't find anything like that in the
>documentation. Is  it possible?
>
>Of course, I can show the completions in an other window in the same
>frame  (pop-to-buffer), but a small temporary popup frame above the
>cursor would  be nicer.

I'm not sure what you mean by 

  "emacs support for a language and want to display suggestions for
   the user in a pop up frame."

but it could be that if you add support for semantic
(cedet.sf.net/semantic.shtml), even if you don't use the full parser
architecture, you could use the popup tooltip like support built into
that framework without having to figure out pixel positions.
Cedet/Semantic tries to provide smart completions at idle time.  If
that's what you are looking to do, it may be a little easier, plus you
would get a host of other useful features at the same time.

Eric

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Cursor position in pixels
  2005-03-14 15:46 ` Eric Ludlam
@ 2005-03-16 15:15   ` PT
  0 siblings, 0 replies; 7+ messages in thread
From: PT @ 2005-03-16 15:15 UTC (permalink / raw)


On Mon, 14 Mar 2005 10:46:04 -0500, Eric Ludlam <eludlam@mathworks.com>  
wrote:
>
> I'm not sure what you mean by
>
>   "emacs support for a language and want to display suggestions for
>    the user in a pop up frame."
>
> but it could be that if you add support for semantic
> (cedet.sf.net/semantic.shtml), even if you don't use the full parser
> architecture, you could use the popup tooltip like support built into
> that framework without having to figure out pixel positions.
> Cedet/Semantic tries to provide smart completions at idle time.  If
> that's what you are looking to do, it may be a little easier, plus you
> would get a host of other useful features at the same time.

Here's a screenshot of what I have in mind:

	http://www.monodevelop.com/images/screenshots/macosx.jpg

So I'd like to popup a small frame listing the possible completions. As  
the user types more characters, the list is narrowed down to show the  
remaining completions. If I go up/down in the list then a short  
description of the highlighted item is shown immediately in a tooltip. If  
the user presses F1 then he's taken to the complete documentation of the  
item (e.g. in a browser).

I don't think Semantic provides the framework for all this, but correct me  
if I'm wrong.

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-03-16 15:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-04 18:18 Cursor position in pixels PT
2005-03-05 11:01 ` Eli Zaretskii
     [not found] ` <mailman.2686.1110021568.32256.help-gnu-emacs@gnu.org>
2005-03-05 17:45   ` PT
2005-03-05 21:35 ` Stefan Monnier
2005-03-09 18:19   ` PT
2005-03-14 15:46 ` Eric Ludlam
2005-03-16 15:15   ` PT

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).