15 Example: Using The Interface Builder
Row-Layout-1to the elements you add to an interface; you usually want to replace these with your own names. In addition, there are probably titles that you want to add to the interface; you can see the default titles that have been created by looking at the interface skeleton. The next stage of the example shows you how to change these default names and titles.
Changing the name or title of an element is actually just a case of changing the value assigned to an attribute of that element, as described in Section 14.5.4 on page 201. You would normally assign values to a number of different attributes at once, rather than concentrating on the names and titles of elements. The example is structured in this way to give you an idea of the sort of working practices you might find it useful to adopt when generating interface code.
To recap, the layout hierarchy of the example interface is shown in Figure 15.2. To ensure that you can understand this layout easily in the future, it is important to assign meaningful names and titles to the elements it contains now.
Figure 15.2 Layout hierarchy of the example interface
INTERFACE-1object and press Return.
Figure 15.3 Attributes dialog for the example interface
INTERFACE-1, and the TITLE attribute has the value
IB-EXAMPLEin the Layout hierarchy area, and the title of the interface skeleton changes to
Column-Layout-1element, display its Attributes dialog, and change the value of its NAME attribute to
graph, and its INTERACTION attribute to
:extended-selection. Click OK.
list, and its INTERACTION attribute to
:extended-selection. Do not click OK yet.
'("One" "Two" "Three" "Four" "Five" "Six" "Seven" "Eight")
:center. Click OK.
display-layoutobject is going to show information about the current selection, so you need to change the names and titles of the objects it contains accordingly.
selection-titleand its TEXT attribute to
"Selection:". Click OK.
selection-text, and its TEXT attribute to
"Displays current selection". Click OK.
Figure 15.4 Layout hierarchy with names specified
Generated with Harlequin WebMaker