fullscreenmode and rect of a substack on mobile device ?

Brian Milby brian at milby7.com
Sun Aug 19 01:16:57 EDT 2018


@Sannyasin

Something just clicked... if fullscreenmode is not empty, then resizestack
messages are not generated.  Which is part of why the new commands were
created.  For what you want with the browser, your handlers should be very
simple.  Here's what I came up with to put the browser widget and a nav bar
on a card.  I didn't need to mess with orientation changed messages at all
since the relative positions of everything is static.  Here's my very
simplified card script:

on preOpenCard
   if the environment is "mobile" then
      set the fullscreenmode of this stack to empty
   end if
   resizeStack the width of this stack, the height of this stack
end preOpenCard

on resizeStack pNewWidth, pNewHeight, pOldWidth, pOldHeight
   local tBrowserRect, tNavbarRect

   put 0, 0, pNewWidth, pNewHeight - 50 into tBrowserRect
   put 0, pNewHeight - 50, pNewWidth, pNewHeight into tNavbarRect

   lock screen
   set the rect of widget "Browser" of me to tBrowserRect
   set the rect of widget "Navigation Bar" of me to tNavbarRect
   unlock screen
end resizeStack

I tested it out on my iPhone and it seemed to work well.  (The preOpenCard
resizeStack is needed or else the card will be displayed in whatever size
it was originally developed in at the top left of the screen.)

Thanks,
Brian



More information about the use-livecode mailing list