CHAPTER 6 MAKING DECISIONS WITH CONDITIONAL LOGIC (Yahoo web hosting)
CHAPTER 6 MAKING DECISIONS WITH CONDITIONAL LOGIC 177 Note When executed on Windows, the RB Number Guess game displays a number representing the current location of the Handle on the Slider control. This number dynamically changes as you move the Handle, allowing the player to specify, with precision, their next guess. This behavior is not replicated on Macintosh and Linux, though. Instead, players do not see this value until they have completed their turn and released the Handle. This application highlights an example of the many differences in how things work on Macintosh, Windows, and Linux. You may want to modify the game, so the Slider control is replaced with a EditField and PushButton control, allowing players to key in their guesses instead, when run on Macintosh or Linux. Making this modification gives you the opportunity to work with the #If #EndIf statement and can help further enhance your appreciation of the types of obstacles that must be overcome when developing cross-platform applications. Putting Together the Game s User Interface The RB Number Guess game is primarily controlled through a Slider control and two PushButton controls. StaticText and EditField controls are used to display output. In addition, a GroupBox control is used to help organize the display of game statistics that are collected and displayed during and after game play. The first step involved in creating the RB Number Guess game is to create a new REALbasic desktop application. Next, let s give the application its own icon by opening the Project Editor and setting the Icon property for App to 123.bmp. You can find a copy of this bitmap file along with the source code for this project on the book s companion CD. Note By setting the App item s Icon property, you change the icon associated with the application, giving it a more professional look. To do so, click the App item s Icon property. REALbasic responds by displaying the Edit Icon window. Right-click the Image area and select the Add menu item from the context menu that appears. REALbasic then displays an Open dialog, letting you specify the name and location of the desired graphic image. Once selected, click OK to close the Open dialog. The selected graphic now appears in the Edit Icon window. Click OK to close this window and return to the Project Editor. Next, resize Window1, as specified in Table 6-6. Add a GroupBox control and populate it with four StaticText and four EditField controls. Then, add a Slider control and resize it, so it takes up most of the width of the window. Place two PushButton controls just beneath it and add two StaticText controls, one over each end of the Slider control. Finally, add a EditField Control and a StaticText control just over the top center location of the Slider control. When done, your new application s interface should look just like the example shown in Figure 6-3.
Searching for affordable and proven webhost to host and run your servlet applications? Go to Linux Web Hosting services and you will find it.