scrollerdidscroll, but WHAT has bee scrolled?

Ralph DiMola rdimola at evergreeninfo.net
Sat Jun 2 13:02:30 EDT 2018


Klaus,

I name the scroller the same as the control it's scrolling. The
"scrollderdidscroll" is only sent to the stack that created it. If you have
a generic "create scroller" handler in a library stack then the
"scrollderdidscroll" message will only go to that stack. In the context of
"scrollderdidscroll" message "this stack" is the library stack. If you want
a truly generic scroller in a library stack then you would also have to put
the stack name into the control ID along with the LC control name and parse
it out in the "scrollderdidscroll" handler later. In my case there is only
one stack for the GUI so it's easy to know what the stack the control is in.
Here's my generic "scrollderdidscroll" I have this in a library stack(along
with generic scroller create handle).

on scrollerDidScroll hScrolled, vScrolled
   local ControlID
   
      put mobileControlTarget() into ControlID

      set the vscroll of control ControlID of stack "MainStackGUI" to
vscrolled
      set the hscroll of control ControlID of stack "MainStackGUI" to
hscrolled
      
   pass scrollerDidScroll
end scrollerDidScroll

Ralph DiMola
IT Director
Evergreen Information Services
rdimola at evergreeninfo.net

-----Original Message-----
From: use-livecode [mailto:use-livecode-bounces at lists.runrev.com] On Behalf
Of Klaus major-k via use-livecode
Sent: Saturday, June 02, 2018 8:05 AM
To: How to use LiveCode
Cc: Klaus major-k
Subject: scrollerdidscroll, but WHAT has bee scrolled?

Hi friends,

this interesting question came up in the german LC forum.

If you have 2 native scrollers on a card, how do you differ in the
"scrollderdidscroll" handler WHICH one has been actually scrolled? 
Know what i mean?

I would have exspected an appropriate parameter pContolID like in
"mobilecontroldo", but could not find anything in the dictionary about
"scrollerdidscroll".

Thaks for any hints!


Best

Klaus
--
Klaus Major
http://www.major-k.de
klaus at major-k.de


_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the Use-livecode mailing list