Front and Back Scripts on Mobile
Sannyasin Brahmanathaswami
brahma at hindu.org
Tue Jul 5 18:04:43 EDT 2016
Hmmm, today it's not working… not sure how to debug… but buildomh on stand alone with this in the backscript
command CreateScroller pName -- scrolling regions,groups, fields
if not isMobile() then exit CreateScroller
deleteMobileControl pName -- delete any existing
put (the rect of control pName) into tRect
mobileControlCreate "scroller", pName
mobileControlSet pName, "rect", tRect
put ("0,0," & (the formattedwidth of control pName) & "," & the formattedheight of control pName) into tRect
mobileControlSet pName, "contentRect" , tRect
mobileControlSet pName, "hScroll" , 0
mobileControlSet pName, "vScroll" , 0
mobileControlSet pName, "hIndicator" , false
mobileControlSet pName, "visible", true
end CreateScroller
on scrollerDidScroll hScrolled, vScrolled
put mobileControlTarget() into tControlID
set the vscroll of control tControlID to vscrolled
pass scrollerDidScroll
end scrollerDidScroll
is failing… the control will not scroll
From: use-livecode <use-livecode-bounces at lists.runrev.com> on behalf of Richard Gaskin <ambassador at fourthworld.com>
Reply-To: How LiveCode <use-livecode at lists.runrev.com>
Date: Saturday, July 2, 2016 at 8:47 AM
To: How LiveCode <use-livecode at lists.runrev.com>
Subject: Re: Front and Back Scripts on Mobile
I believe a more accurate description is that the scrollerDidScroll
message is sent to the *script* that created the scroller, which many
not necessarily be a stack.
In my case it's a backscript, and it works well.
It seemed painfully tedious to even think about typing scroller
instantiation code for every controls that needs it, so I don't.
Instead, a backscript scans controls during preOpenCard and anything
that needs a scroller gets one instantiated for it (along the way it
also turns off scrollbars, since of course those are only useful on
desktop).
More information about the use-livecode
mailing list