changeset 7222:3dae5675cd3e

(scroll-bar-event-ratio): New function.
author Richard M. Stallman <rms@gnu.org>
date Sat, 30 Apr 1994 07:23:15 +0000
parents a2c7acc3be9c
children 38931e897e56
files lisp/scroll-bar.el
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/scroll-bar.el	Sat Apr 30 07:00:37 1994 +0000
+++ b/lisp/scroll-bar.el	Sat Apr 30 07:23:15 1994 +0000
@@ -34,6 +34,13 @@
 
 ;;;; Utilities.
 
+(defun scroll-bar-event-ratio (event)
+  "Given a scroll bar event EVENT, return the scroll bar position as a ratio.
+The value is a cons cell (PORTION . WHOLE) containing two integers
+whose ratio gives the event's vertical position in the scroll bar, with 0
+referring to the top and 1 to the bottom."
+  (nth 2 event))
+
 (defun scroll-bar-scale (num-denom whole)
   "Given a pair (NUM . DENOM) and WHOLE, return (/ (* NUM WHOLE) DENOM).
 This is handy for scaling a position on a scroll bar into real units,