chasing the thumb in a scrollbar

Mark Swindell mdswindell at cruzio.com
Fri Feb 6 00:18:12 EST 2009


Can one refer to the location of just the thumb of a scrollbar  
relative to its window?  I want to chase the thumb with a a graphic...  
essentially a transparent rectangle whose left would stick to the left  
of a horizontal scrollbar and whose right would follow the thumb as it  
moves.   I can use the mouseLoc to come close, but it isn't exact, and  
I also need to refer to the loc of the thumb from outside the  
scrollbarDrag handler.

This is the idea:

on scrollbarDrag newPosition
     put the top of graphic "yellowRect" into vTheTop -- maintains  
height of graphic
     put the bottom of graphic "yellowRect" into vTheBottom --  
maintains hieght of graphic
     put the left of scrollbar 1 into vTheLeft -- sets left of graphic  
to the left of the scrollbar

    ***put item 1 of (the loc of the THUMB of scrollbar 1) into  
vTheRight -- this is the idea... but how??? I can use the mouseLoc  
here but it's not precise

     set the rect of graphic "yellowRect" to  
vTheLeft,vTheTop,vTheRight,vTheBottom
end scrollbarDrag

Thanks
Mark


More information about the use-livecode mailing list