From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Feng Shu" Newsgroups: gmane.emacs.devel Subject: Re: How to get information of a tip created by x-show-tip Date: Sat, 19 Jan 2019 17:06:36 +0800 Message-ID: <87tvi5ow2r.fsf@163.com> References: <87k1j1b782.fsf@163.com> <5C42DC09.6040500@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1547888723 6173 195.159.176.226 (19 Jan 2019 09:05:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 19 Jan 2019 09:05:23 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: Emacs-Devel devel To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 19 10:05:19 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gkmZ4-0001Sd-Nj for ged-emacs-devel@m.gmane.org; Sat, 19 Jan 2019 10:05:19 +0100 Original-Received: from localhost ([127.0.0.1]:53210 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkmbB-0004Wq-Gx for ged-emacs-devel@m.gmane.org; Sat, 19 Jan 2019 04:07:29 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkmaa-0004WY-Ph for emacs-devel@gnu.org; Sat, 19 Jan 2019 04:06:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gkmaZ-0007xF-T7 for emacs-devel@gnu.org; Sat, 19 Jan 2019 04:06:52 -0500 Original-Received: from m12-15.163.com ([220.181.12.15]:46670) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkmaY-0007q0-Ij for emacs-devel@gnu.org; Sat, 19 Jan 2019 04:06:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-ID:MIME-Version; bh=fO6YC SuYsa31zxI3sYz3CCvxpvQ7sfuAaSOoHiRbZkc=; b=fhwStXzrSe80rysJeA6Qs kxiMBRRM+hgSSxOzsORbTwLwpLeY0QQX1VCq5UXHSKYIoy4KIdfRIXdheV2ztsb9 +qhVAEE4eEdWdzRy5Kn/Sg4PEojdMi7XOilMIniKkiWLr/mYGcqrBaBsYqgXihci l69LW7A7DSwI6EpQktZQ8E= Original-Received: from tumashu (unknown [112.3.141.143]) by smtp11 (Coremail) with SMTP id D8CowACHu9Cd6EJcSIkZBw--.9989S2; Sat, 19 Jan 2019 17:06:37 +0800 (CST) In-Reply-To: <5C42DC09.6040500@gmx.at> (martin rudalics's message of "Sat, 19 Jan 2019 09:12:57 +0100") X-CM-TRANSID: D8CowACHu9Cd6EJcSIkZBw--.9989S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7tr18uF18GFWkXr1rAw13urg_yoW8Ww4DpF WUu3sxWFyDWr47Ar1vyw1fJFy5C3s7Xay3KrZ7Jr10yay5tr1IvrW3tw4UAFWUGws8Wr1j 9FsYkryUWws2yFJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jVoGQUUUUU= X-Originating-IP: [112.3.141.143] X-CM-SenderInfo: 5wxpt2lkx6il2tof0z/1tbiHR9B1FSIc026CwAAsE X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 220.181.12.15 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:232474 Archived-At: martin rudalics 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 > --