Scrollbar question

Michael J. Lew michaell at unimelb.edu.au
Thu Jun 17 19:31:10 EDT 2004


Howard wrote:
>The scrollbarDrag message is sent whenever a scrollbar is moved. Is
>there a way to distinguish which scrollbar is actually being moved in a
>group where both the horizontal and vertical scrollbars are enabled?
>

Here is a script that gets around the lack of discrimination in the 
scrollbarDrag message:

on scrollbardrag
   put item 1 of the mouseLoc into X
   put item 2 of the mouseLoc into Y
   if X>=(the right of the target -the scrollbarWidth of the target) 
then put "Vertical scroll"
   if Y>=(the bottom of the target -the scrollbarWidth of the target) 
then put "Horizontal scroll"
end scrollbardrag

Works OK in my minimal testing, hope it helps you.

-- 
Michael J. Lew

Senior Lecturer
Department of Pharmacology
The University of Melbourne
Parkville 3010
Victoria
Australia

Phone +613 8344 8304

**
New email address: michaell at unimelb.edu.au
**


More information about the use-livecode mailing list