summaryrefslogtreecommitdiff
path: root/lisp/tooltip.el
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2000-11-18 12:56:26 +0000
committerGerd Moellmann <gerd@gnu.org>2000-11-18 12:56:26 +0000
commite4df9b40fdbd25a907724c9b5f7b90d1022edfd5 (patch)
tree77735fbf9265090d25bd5c63304eebe0d2cd0019 /lisp/tooltip.el
parent24127af0a0e790319c72c4d447b166b04efa4e89 (diff)
downloademacs-e4df9b40fdbd25a907724c9b5f7b90d1022edfd5.tar.gz
(tooltip-x-offset, tooltip-y-offset): New user-options.
(tooltip-show): Use the offsets.
Diffstat (limited to 'lisp/tooltip.el')
-rw-r--r--lisp/tooltip.el29
1 files changed, 28 insertions, 1 deletions
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index 5916df0273d..f5953f49c7e 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -76,6 +76,28 @@ Do so after `tooltip-short-delay'."
:group 'tooltip)
+(defcustom tooltip-x-offset nil
+ "Specify an X offset for the display of tooltips.
+The offset is relative to the position of the mouse. It must
+be chosen so that the tooltip window doesn't contain the mouse
+when it pops up."
+ :tag "X offset"
+ :type '(choice (const :tag "Default" nil)
+ (integer :tag "Offset" :value 1))
+ :group 'tooltip)
+
+
+(defcustom tooltip-y-offset nil
+ "Specify an Y offset for the display of tooltips.
+The offset is relative to the position of the mouse. It must
+be chosen so that the tooltip window doesn't contain the mouse
+when it pops up."
+ :tag "Y offset"
+ :type '(choice (const :tag "Default" nil)
+ (integer :tag "Offset" :value 1))
+ :group 'tooltip)
+
+
(defcustom tooltip-frame-parameters
'((name . "tooltip")
(foreground-color . "black")
@@ -284,7 +306,12 @@ ACTIVATEP non-nil means activate mouse motion events."
"Show a tooltip window at the current mouse position displaying TEXT."
(if tooltip-use-echo-area
(message "%s" text)
- (x-show-tip text (selected-frame) tooltip-frame-parameters)))
+ (x-show-tip text
+ (selected-frame)
+ tooltip-frame-parameters
+ nil
+ tooltip-x-offset
+ tooltip-y-offset)))
(defun tooltip-hide (&optional ignored-arg)
"Hide a tooltip, if one is displayed.