From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: How to handle mouse events Date: Mon, 24 Apr 2006 12:23:27 +0200 Organization: University Koblenz-Landau Campus Koblenz Message-ID: <874q0jclwg.fsf@baldur.nicundtas.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1145878858 31484 80.91.229.2 (24 Apr 2006 11:40:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 24 Apr 2006 11:40:58 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Apr 24 13:40:57 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FXzQx-00066A-Dj for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Apr 2006 13:40:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FXzQw-0005c4-Rh for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Apr 2006 07:40:50 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.gamma.ru!Gamma.RU!npeer.de.kpn-eurorings.net!rz.uni-karlsruhe.de!news.belwue.de!news.uni-kl.de!cache.uni-koblenz.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 54 Original-NNTP-Posting-Host: dslb-084-063-064-007.pools.arcor-ip.net Original-X-Trace: cache.uni-koblenz.de 1145874208 25609 84.63.64.7 (24 Apr 2006 10:23:28 GMT) Original-X-Complaints-To: news@cache.uni-koblenz.de Original-NNTP-Posting-Date: Mon, 24 Apr 2006 10:23:28 +0000 (UTC) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAD1BMVEW2mhnXu0n26aD9/fXC t48P8QWWAAAACXBIWXMAAAsSAAALEgHS3X78AAAATnRFWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYA CmV4aWYKICAgICAgMjAKNDU3ODY5NjYwMDAwNGQ0ZDAwMmEwMDAwMDAwODAwMDAwMDAwMDAwMAqJ uBZbAAAACXZwQWcAAAAwAAAAMADO7oxXAAABkElEQVQ4y3WTDZKDIAyFgycA2gNI4gHahAN07d7/ TPsCWuuqjKMwX/Lyh2QnS1M26lsx/QITJWlAY7Zp3hwiBe6AiCPlFVQiyg50JF9BFlDmAjC9rYbY yLCCrAA1aAwJT1pdKgsDMEG9JAB8xZBC9aBM6uJasiA8LGaTBBBuQCGLwlaLR5pyQShGuhqT2NOL cJeABLN7CEHF7JdxkEKEQAHnJwB6IexKY+aU8ohuAOTekgkOMwXjzCV5Ax5LE39gn4hE1DTDyMYO NCMaQre2eZEKCT89mWPiQvLp7yANvIZEbIW2gaQOvGSktQFoN4C6PGKX8l1dQPSaEL9Zz2/0nTso LUVrE9S7tGx7HfIRwQXxusTsKxXp03NR3oHmUG7uJSdAWtN3oIqih77x1xd4qSYfnz33AAKY1O3o MQ2GG+S7kXfghQn2O7cHUOJYeB3oBh6DlGGbyAZe3Io7gOrX8X0CvIBRjkDjDVfAjqAG+feDLmDM dg7i+xzUYOcA/805iHzhcbcLMF8AlStgV1In6w8LTb3wgg1GGgAAABp6VFh0SlBFRy1Db2xvcnNw YWNlAAB42jMCAAAzADMRFn5jAAAAJ3pUWHRKUEVHLVNhbXBsaW5nLWZhY3RvcnMAAHjaM6ow0jGs MARhABGDAulkDxtiAAAAAElFTkSuQmCC User-Agent: Gnus/5.110005 (No Gnus v0.5) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:uF4VuB3p0IYsm0YDNBY9g8Tly9M= Original-Xref: shelby.stanford.edu gnu.emacs.help:139006 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:34625 Archived-At: Hi, I wrote a simple dictionary with emacs bindings. One feature I want to implemenet now is to open a tooltip with the translation of the word the mouse is pointing at. So far I wrote this code: ,---- | (defvar rdictcc-tooltip-mode nil | "Indicates wheather the rdictcc tooltip mode is active.") | (nconc minor-mode-alist '((rdictcc-tooltip-mode " RDictCc"))) | | (defun rdictcc-translate-word-under-mouse (event) | "Display translations of the word at the cursor in a tooltip." | (interactive "e") | (let ((word (save-window-excursion | (save-excursion | (mouse-set-point event) | (current-word t t))))) | (message "Word is %s" word) | (tooltip-show (rdictcc-translate-word-to-string word)))) | | (defun rdictcc-tooltip-mode (&optional arg) | "Display tooltips for the current word." | (interactive "P") | (require 'tooltip) | (let ((val (if arg | (> (prefix-numeric-value arg) 0) | (not rdictcc-tooltip-mode)))) | (make-local-variable 'rdictcc-tooltip-mode) | (setq rdictcc-tooltip-mode val) | (tooltip-mode 1) | (add-hook 'tooltip-hook 'rdictcc-translate-word-under-mouse t t) | (make-local-variable 'track-mouse) | (setq track-mouse val))) `---- But there are no tooltips and it seems that I never enter `rdictcc-translate-word-under-mouse', or at least "Word is " is never printed in the echo area. If I enter below code in *scratch* buffer, I get a tooltip with the translation. ,----[ in *scratch* ] | (track-mouse | (rdictcc-translate-word-under-mouse (read-event))) `---- Any help? Bye, Tassilo