O'Reilly logo

LiveCode Mobile Development Beginner's Guide by Colin Holgate

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – simple code layout example

It could get quite complicated if you laid out all of the card's controls with code, so we're only going to construct a simple case, to show the technique. You can enhance this later for more complex cases.

  1. Create a new Mainstack.
  2. Add four buttons across the width of the card.
  3. Put this handler into the card script:
    on resizeStack newWidth,newHeight
       put the width of button 1 into buttonWidth
       put (newWidth - 4 * buttonWidth)/5 into gap
       put the top of button 1 into buttonTop
       repeat with a = 1 to 4
          set the top of button a to buttonTop
          set the left of button a to gap + (a-1) * (gap+buttonWidth)
       end repeat
       pass resizeStack
    end resizeStack
  4. Resize the card window. The buttons should spread out evenly across the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required