Front and Back Scripts on Mobile

Ralph DiMola rdimolad at evergreeninfo.net
Sat Jul 2 06:40:53 EDT 2016


I had this problem way back.  Mark noted that that the scroller messages are sent to the stack that created the scroller.  


Ralph DiMola
IT Director
Evergreen Information Services



<div>-------- Original message --------</div><div>From: Sannyasin Brahmanathaswami <brahma at hindu.org> </div><div>Date:07/02/2016  00:42  (GMT-05:00) </div><div>To: How to use LiveCode <use-livecode at lists.runrev.com> </div><div>Subject: Re: Front and Back Scripts on Mobile </div><div>
</div>

We are looking to use some back scripts on mobile.

If I add this to a backscript

command testMessagePath pMessage
  answer pMessage with "OK"
end testMessagePath


Add this to either a back OR front script.

then add a button to the top of any card in the stack

testMessagePath "Got it"

save and reload the stack… it works on desktop, but not on mobile

OTOH some other commands in the back script *are* firing… because we have some set up functions that are not failing.

Are there caveats for using front and back scripts on mobile that we need understand?

BR


To add more failure points

this works if we put everything in the stack script of the stack that has the scrolling group. but if we move the "createScroller" and isMobile and scrollerDidScroll commands to the back or front script… they fail.

??


on opencard

set the vScroll of grp "portal-links" to 0 -- ensures correct initial alignment

createScroller "portal-links" -- replaces any existing one

end opencard



command CreateScroller pName -- scrolling 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

-- if pName = "quote" then

-- mobileControlSet pName, "vIndicator", true

-- end if

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

function isMobile -- jg, for convenience

return the environment is "mobile"

end isMobile

_______________________________________________
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