The procedure for creating a graphical user interface in an Objective-C project is the same as the procedure for creating a graphical user interface in a Java project.
Each application project, when first created, includes a blank nib file called the "main nib file." This nib file contains the application menu and perhaps one or more windows. Applications automatically load the main nib file when they are launched.
The main nib file has the same name as the project. A default main nib file is also provided for other platforms (in this case, Windows NT).
The window provided for you in the main nib file is too large. To resize a window, drag either lower corner of the window in any direction (up, down, diagonal).
You can resize a window to exact dimensions by entering pixel values in the Size display of Interface Builder's Inspector (see Place and Resize the CustomView Object in the second part of the tutorial for an example of how this is done).
Windows usually carry distinctive titles in, of course, their title bars. In the Yellow Box each window in a screen is based on an instance of NSWindow. The title of a window is an attribute of this object. Interface Builder allows you to set the attributes of NSWindows and many other objects in its Inspector.
To set the title of the TemperatureConverter window:
Interface Builder's Palette window has several palettes full of Application Kit objects. The Views palette holds many of the smaller objects, among which is the text-field object. You now will add two text fields to the TemperatureConverter interface:
This is what the button for the Views palette looks like this when it's selected:
Once you drop the object, you can reposition it in the window by dragging it.
To delete the string, double-click to highlight it, then press the Delete key.
If you need to delete an object in the interface, just select it and press the Delete key.
Earlier you set an attribute of the TemperatureConverter window (its title). Now you need to set an attribute of each of the text fields. All objects on Interface Builder's palettes have attributes that you can set through the Inspector.
Repeat this sequence for the other text field.
You do not have to set the "Send Action--Only on enter" attribute. If what you want is the the default behavior for text fields--the field sends its action message to its target whenever the insertion point leaves it--then leave the "Only on enter" radio button turned off. When this button is turned on, the text field sends its action message only when the user presses the Enter or Return key while the insertion point is in the field.
Text fields without labels would be confusing to users, so solve that problem by labeling each field.
Repeat the steps for the other label ("Celsius").
Occasionally you should save the nib file containing your work. Now is a good time: choose Save from the Document menu.