background image
Change the Text Field Attributes
The bottom text field displays the results of the currency conversion computation and should therefore have
different attributes than the other text fields. It must not be editable by the user.
To make the text field that shows the result cannot be editable by the user:
1.
Select the third text field.
2.
In the Inspector, navigate to the Text Field Attributes tab.
3.
Make sure the Editable option is deselected so that users are not allowed to alter the contents of the
text field. Also make sure the Selectable option is selected so that users can copy the contents of the
text field to other applications.
Configure a Button
The currency conversion should be invoked either by clicking a button or pressing Return. To add a button
to the Currency Converter window:
1.
Drag the Push Button object from the library to the bottom-right corner of the window.
2.
Double-click the button and change its title to Convert.
3.
In the Key Equiv. section of the Button Attributes inspector, click the gray box. Now press Return. A return
symbol should appear in the gray box. This makes the button respond to the Return key as well as to
clicks.
4.
Align the button under the text fields.
a.
Drag the button downward until the layout guide appears, and then release it.
b.
With the button still selected, hold down the Option key. If you move the pointer around, Interface
Builder shows you the distance in pixels from the button to the element over which the pointer is
hovering.
Creating the Currency Converter Window
33
2007-10-31 | © 2007 Apple Inc. All Rights Reserved.
CHAPTER 4
Defining the View: Building the User Interface