From: "Feng Shu" <tumashu@163.com>
To: martin rudalics <rudalics@gmx.at>
Cc: Emacs-Devel devel <emacs-devel@gnu.org>
Subject: Re: How to get information of a tip created by x-show-tip
Date: Sat, 19 Jan 2019 17:06:36 +0800 [thread overview]
Message-ID: <87tvi5ow2r.fsf@163.com> (raw)
In-Reply-To: <5C42DC09.6040500@gmx.at> (martin rudalics's message of "Sat, 19 Jan 2019 09:12:57 +0100")
martin rudalics <rudalics@gmx.at> writes:
>> I want to get a tip's information created by x-show-tip, for
>> example: width, height, x and y
>>
>> but I fail to find the way, anyone can help me?
>
> We have invested some efforts to hide information about the tooltip
> implementation. The major reason was to protect our own routines from
> operating on tooltip frames and windows. Compare, for example,
>
> http://lists.gnu.org/archive/html/emacs-devel/2018-02/msg00694.html
>
> From there you can see that the return value of 'visible-frame-list'
> and the 'tooltip' frame paramter can give you the current tooltip
> frame if it is visible and native (that is created by Emacs itself).
> The size and position paramters of that frame should give you the
> values you cited above.
>
I use the following code to test, but failure
1. width and height parameter do not work
2. I can find any frame with 'tooltip parameter
```
(setq tooltip-reuse-hidden-frame t)
(setq x-gtk-use-system-tooltips nil)
(progn
(x-show-tip "this is a test"
(selected-frame)
'((name . "tooltip1")
(internal-border-width . 2)
(left . 200)
(top . 300)
(width . 200)
(height . 600)
(border-width . 1)
(no-special-glyphs . t))
100 0 0)
(dolist (frame (visible-frame-list))
(princ (frame-parameter frame 'tooltip))))
```
>> by the way, is a tip a window or a frame?
>
> 'tooltip' (or 'tip') usually refer to the text only. Emacs can put
> that text into a window, that window into a frame and ask the window
> system to display that frame in a window-system window. But Emacs can
> drop that text directly to GTK in which case no frame will be made.
> For GTK tooltips no information can be retrieved.
>
> martin
>
--
next prev parent reply other threads:[~2019-01-19 9:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-19 4:29 How to get information of a tip created by x-show-tip Feng Shu
2019-01-19 7:22 ` Eli Zaretskii
2019-01-19 8:12 ` martin rudalics
2019-01-19 9:06 ` Feng Shu [this message]
2019-01-19 9:32 ` martin rudalics
2019-01-19 9:37 ` Feng Shu
2019-01-19 9:55 ` Eli Zaretskii
2019-01-19 10:02 ` Feng Shu
2019-01-19 9:54 ` Feng Shu
2019-01-19 12:20 ` martin rudalics
2019-01-20 1:21 ` Feng Shu
2019-01-20 2:09 ` Drew Adams
2019-01-19 9:36 ` martin rudalics
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=87tvi5ow2r.fsf@163.com \
--to=tumashu@163.com \
--cc=emacs-devel@gnu.org \
--cc=rudalics@gmx.at \
/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.