Book Image

LiveCode Mobile Development Cookbook

By : Dr. Edward Lavieri
Book Image

LiveCode Mobile Development Cookbook

By: Dr. Edward Lavieri

Overview of this book

Table of Contents (17 chapters)
LiveCode Mobile Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using a toggle button


In this recipe, you will learn how to use a MobGUI toggle button, which is also referred to as a switch. You will create a mood toggle to display how you are feeling.

Getting ready

Before using this recipe, you will need to have the MobGUI plugin downloaded and installed on your development computer. See the Setting up MobGUI recipe discussed earlier in this chapter.

How to do it...

Follow the steps in this recipe to create a toggle button and allow the user to select between mood values of Happy and Sad:

  1. Create a new main stack in LiveCode.

  2. From the Development menu, navigate to Plugins | revMobGUI.

  3. Click on the play button, shown in the following screenshot, from the icons on the MobGUI interface:

  4. Drag the icon from the MobGUI interface to the card. This will result in a group being added to the card.
  5. Using the property inspector, change the width to 128.

  6. Using the property inspector, change the position of the group so that it is at location 160,58.

  7. Click on the new toggle...