all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#5703: 23.1.92; `x-show-tip' and `tooltip-frame-parameters' do not respect `left' and `top'
@ 2010-03-11  7:49 Drew Adams
  2010-03-11  8:02 ` bug#5703: 23.1.92; `x-show-tip' and `tooltip-frame-parameters' do not respect `left'and `top' Drew Adams
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Drew Adams @ 2010-03-11  7:49 UTC (permalink / raw
  To: 5703

emacs -Q

M-: (x-show-tip "aaaaaaaa" (selected-frame)
                '((left . 30) (top . 40)) 10 0 0)

Or something similar. Instead of displaying the tooltip frame at the absolute
location specified by `left' and `top', it always displays it at the mouse
position plus the DX and DY (0 and 0 here).

Also, the tooltip does not remain displayed for the 10 seconds specified, but
perhaps that is due to the way this is evaluated (M-:).

As another example (easier to see), evaluate this:

(let ((tooltip-frame-parameters '((nil . "tooltip")
                                  (left . 100)
                                  (top . 200))))
  (tooltip-show "aaaaaaaaa" nil))

In this case, the tooltip is always shown with an offset of 5 (the default DX
and DY) from the mouse pointer. 

The `left' and `right' parameters are ignored. Even the doc string of
`tooltip-frame-parameters' says that `left' and `top' should be respected.
Instead, the mouse pointer position is always used.

Another illustration:

M-: (my-show "aaaaaa" nil 100 200)

where `my-show' is the same as `tooltip-show' except that it accepts optional
LEFT and TOP params, to override `tooltip-frame-parameters':

(defun my-show (text &optional use-echo-area left top)
  "..."
  (if use-echo-area
      (tooltip-show-help-non-mode text)
    (condition-case error
	(let ((params (copy-sequence tooltip-frame-parameters))
	      (fg (face-attribute 'tooltip :foreground))
	      (bg (face-attribute 'tooltip :background)))
	  (when (stringp fg)
	    (setq params (tooltip-set-param params 'foreground-color fg))
	    (setq params (tooltip-set-param params 'border-color fg)))
	  (when (stringp bg)
	    (setq params (tooltip-set-param params 'background-color bg)))
          (when left (setq params  (tooltip-set-param params 'left left)))
          (when top  (setq params  (tooltip-set-param params 'top top)))
	  (x-show-tip (propertize text 'face 'tooltip)
		      (selected-frame)
		      params
		      tooltip-hide-delay
		      tooltip-x-offset
		      tooltip-y-offset))
      (error
       (message "Error while displaying tooltip: %s" error)
       (sit-for 1)
       (message "%s" text)))))

`tooltip-show' should in fact be modified in this way (adding optional LEFT and
TOP), IMO, so that you can easily show the tooltip anywhere without first adding
the location to `tooltip-frame-parameters' (e.g. as in the `let' example). But
the bug needs to be fixed first.


In GNU Emacs 23.1.92.1 (i386-mingw-nt5.1.2600)
 of 2010-02-20 on LENNART-69DE564
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --no-opt --cflags -Ic:/g/include
-fno-crossjumping'







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

end of thread, other threads:[~2010-03-31  9:17 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-11  7:49 bug#5703: 23.1.92; `x-show-tip' and `tooltip-frame-parameters' do not respect `left' and `top' Drew Adams
2010-03-11  8:02 ` bug#5703: 23.1.92; `x-show-tip' and `tooltip-frame-parameters' do not respect `left'and `top' Drew Adams
2010-03-12 14:53   ` bug#5703: 23.1.92; `x-show-tip' and `tooltip-frame-parameters' do not respect`left'and `top' Drew Adams
2010-03-13 20:15 ` bug#5703: 23.1.92; `x-show-tip' and `tooltip-frame-parameters' do not respect `left' and `top' Chong Yidong
2010-03-13 20:15 ` Chong Yidong
2010-03-13 22:03   ` Christoph
2010-03-14  4:49     ` Drew Adams
2010-03-14  4:49     ` bug#5703: " Drew Adams
2010-03-30 13:18     ` Eli Zaretskii
2010-03-30 13:15   ` bug#5703: " Eli Zaretskii
2010-03-30 14:41     ` Jason Rumney
2010-03-30 14:41     ` Jason Rumney
2010-03-30 16:23       ` Eli Zaretskii
2010-03-30 16:23       ` Eli Zaretskii
2010-03-30 23:33     ` YAMAMOTO Mitsuharu
2010-03-30 23:33     ` YAMAMOTO Mitsuharu
2010-03-31  9:17       ` Eli Zaretskii
2010-03-31  9:17       ` Eli Zaretskii
2010-03-30 13:15   ` Eli Zaretskii

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.