all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* tooltip-show with a timer
@ 2009-01-31 16:39 Erik Iverson
  2009-01-31 16:42 ` Erik Iverson
  0 siblings, 1 reply; 3+ messages in thread
From: Erik Iverson @ 2009-01-31 16:39 UTC (permalink / raw
  To: help-gnu-emacs

Hello all,

Could someone help me understand what is going on here?

Define a function called moving-tooltip, which simply shows a tooltip that says 
"hi".


(defun moving-tooltip ()
  (tooltip-show "hi"))

Then, hook the new function up to a timer that runs every two seconds.

(run-with-timer 1 2 'moving-tooltip)

Let the mouse come to rest, and you'll see the tooltip.  Don't move the mouse, 
and the next time the tooltip timer is called, the tooltip gets moved 
(specifically, to the upper-left corner of my screen).

Any ideas as to what is happening here?

I'd love it if the tooltip just stayed where it was if the mouse didn't move.

Thanks,
Erik




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

* Re: tooltip-show with a timer
  2009-01-31 16:39 tooltip-show with a timer Erik Iverson
@ 2009-01-31 16:42 ` Erik Iverson
  2009-01-31 21:10   ` Thierry Volpiatto
  0 siblings, 1 reply; 3+ messages in thread
From: Erik Iverson @ 2009-01-31 16:42 UTC (permalink / raw
  To: help-gnu-emacs

If you don't know, you can then cancel the timer with

M-x cancel-function-timers <RET> moving-tooltip <RET>

Erik Iverson wrote:
> Hello all,
> 
> Could someone help me understand what is going on here?
> 
> Define a function called moving-tooltip, which simply shows a tooltip 
> that says "hi".
> 
> 
> (defun moving-tooltip ()
>  (tooltip-show "hi"))
> 
> Then, hook the new function up to a timer that runs every two seconds.
> 
> (run-with-timer 1 2 'moving-tooltip)
> 
> Let the mouse come to rest, and you'll see the tooltip.  Don't move the 
> mouse, and the next time the tooltip timer is called, the tooltip gets 
> moved (specifically, to the upper-left corner of my screen).
> 
> Any ideas as to what is happening here?
> 
> I'd love it if the tooltip just stayed where it was if the mouse didn't 
> move.
> 
> Thanks,
> Erik
> 
> 




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

* Re: tooltip-show with a timer
  2009-01-31 16:42 ` Erik Iverson
@ 2009-01-31 21:10   ` Thierry Volpiatto
  0 siblings, 0 replies; 3+ messages in thread
From: Thierry Volpiatto @ 2009-01-31 21:10 UTC (permalink / raw
  To: help-gnu-emacs

Hi
Erik Iverson <iverson@biostat.wisc.edu> writes:

> If you don't know, you can then cancel the timer with
>
> M-x cancel-function-timers <RET> moving-tooltip <RET>

If you want to cancel timer you have to set it explicitely:

,----
| (setq my-timer (run-with-timer ....))
| (cancel-timer my-timer)
`----

> Erik Iverson wrote:
>> Hello all,
>>
>> Could someone help me understand what is going on here?
>>
>> Define a function called moving-tooltip, which simply shows a
>> tooltip that says "hi".
>>
>>
>> (defun moving-tooltip ()
>>  (tooltip-show "hi"))
>>
>> Then, hook the new function up to a timer that runs every two seconds.
>>
>> (run-with-timer 1 2 'moving-tooltip)
>>
>> Let the mouse come to rest, and you'll see the tooltip.  Don't move
>> the mouse, and the next time the tooltip timer is called, the
>> tooltip gets moved (specifically, to the upper-left corner of my
>> screen).
>>
>> Any ideas as to what is happening here?

,----[ C-h f tooltip-show RET ]
| tooltip-show is a compiled Lisp function in `tooltip.el'.
| 
| (tooltip-show text &optional use-echo-area)
| 
| Show a tooltip window displaying text.
| 
| Text larger than `x-max-tooltip-size' is clipped.
| 
| If the alist in `tooltip-frame-parameters' includes `left' and `top'
| parameters, they determine the x and y position where the tooltip
| is displayed.  Otherwise, the tooltip pops at offsets specified by
| `tooltip-x-offset' and `tooltip-y-offset' from the current mouse
| position.
| 
| Optional second arg use-echo-area non-nil means to show tooltip
| in echo area.
| 
| ===*===*===*===*===*===*===*===*===*===*===
`----

>> I'd love it if the tooltip just stayed where it was if the mouse
>> didn't move.
>>
>> Thanks,
>> Erik
>>
>>
>
>
>

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France





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

end of thread, other threads:[~2009-01-31 21:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-31 16:39 tooltip-show with a timer Erik Iverson
2009-01-31 16:42 ` Erik Iverson
2009-01-31 21:10   ` Thierry Volpiatto

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.