all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: 5703@debbugs.gnu.org
Subject: bug#5703: 23.1.92; `x-show-tip' and `tooltip-frame-parameters' do not respect `left' and `top'
Date: Wed, 10 Mar 2010 23:49:35 -0800	[thread overview]
Message-ID: <DF5796ECD96A4DD2807094BE7934B041@us.oracle.com> (raw)

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'







             reply	other threads:[~2010-03-11  7:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-11  7:49 Drew Adams [this message]
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     ` bug#5703: " Drew Adams
2010-03-14  4:49     ` Drew Adams
2010-03-30 13:18     ` Eli Zaretskii
2010-03-30 13:15   ` bug#5703: " Eli Zaretskii
2010-03-30 13:15   ` Eli Zaretskii
2010-03-30 14:41     ` Jason Rumney
2010-03-30 16:23       ` Eli Zaretskii
2010-03-30 16:23       ` Eli Zaretskii
2010-03-30 14:41     ` Jason Rumney
2010-03-30 23:33     ` YAMAMOTO Mitsuharu
2010-03-31  9:17       ` Eli Zaretskii
2010-03-31  9:17       ` Eli Zaretskii
2010-03-30 23:33     ` YAMAMOTO Mitsuharu

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=DF5796ECD96A4DD2807094BE7934B041@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=5703@debbugs.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.