15 Example: Using The Interface Builder
Row-Layout-1
to 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-1
object and press Return.
Figure 15.3 Attributes dialog for the example interface
INTERFACE-1
, and the TITLE attribute has the value"Interface-1"
.
ib-example
.
"Example Interface"
.
IB-EXAMPLE
in the Layout hierarchy area, and the title of the interface skeleton changes toExample Interface
.
Column-Layout-1
element, display its Attributes dialog, and change the value of its NAME attribute tomain-layout
.
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")
display-layout
.
:center
. Click OK.
display-layout
object 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-title
and 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