source: branches/event-ide/ccl/examples/cocoa/currency-converter/HOWTO_files/pages/building_ui_tiger.html @ 7928

Last change on this file since 7928 was 7928, checked in by gz, 13 years ago

Update from trunk to rev 7927

File size: 6.2 KB
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2          "">
3<html xmlns="">
4  <head>
5    <title>CurrencyConverter HOWTO</title>
6    <link rel="stylesheet" type="text/css" href="../stylesheets/styles.css" />
7  </head>
9  <body>
11    <div class="title">
12      <h1>Building the User Interface on "Tiger"</h1>
13    </div>
15    <div class="body-text">
16      <p>If you are using Mac OS X 10.4.x ("Tiger") to build your
17      application, then the Apple tutorial's section on building the
18      UI may be somewhat confusing. Apple's tutorial uses
19      InterfaceBuilder 3.x to show how to build an interface, and
20      there were many interface changes between versions 2.x and 3.x
21      of InterfaceBuilder. In this section we see how to build the UI
22      using InterfaceBuilder 2.x.</p>
24      <div class="section-head">
25        <h2>Launch InterfaceBuilder</h2>
26      </div>
28      <p>Start by locating Apple's InterfaceBuilder application. If
29        you installed Apple's Developer Tools, InterfaceBuilder should
30        be in the folder "/Developer/Applications/":</p>
32      <div class="inline-image">
33        <img src="../images/finder-win2.jpg"alt="" 
34             border='0'/>
35      </div>
37      <p class= "note"><strong><em>NOTE:</em></strong> If you have not
38        installed Apple's Developer Tools, you should do that now. You
39        will not be able to build the CurrencyConverter example
40        without them. The Developer Tools are distributed as an
41        optional install with Mac OS X 10.4 ("Tiger"). Look for the
42        "XCode Tools" package in the "Optional Installs" folder on the
43        Mac OS 10.4 install disk.</p>
45      <p>Once you have located InterfaceBuilder, double-click to launch
46        the application. InterfaceBuilder presents a window you can use
47        to choose a template for the nibfile you are going to create.</p>
49      <div class="inline-image">
50        <img src="../images/ibwin-tiger1.jpg"alt="" 
51             border='0'/>
52      </div>
54      <p>Make sure the "Application" option is selected in the "Cocoa"
55      section and click the "New" button to create a new
56      nibfile. InterfaceBuilder creates a new application nibfile, but
57      doesn't immediately save it. The Objective C objects that
58      represent the new application's interface appear in a new
59      untitled window:</p>
61      <div class="inline-image">
62        <img src="../images/ibwin-tiger2.jpg"alt="" 
63             border='0'/>
64      </div>
66      <p>The intial window and menubar also appear on the screen. The
67      new application's name appears in the menus as
68      "NewApplication". Save the new nibfile into the
69      "currency-converter" folder that you created earlier
70      (on <a href="making_project.html">this page</a>). Give the new
71      file the name "CurrencyConverter.nib"</p>
73      <div class="note">
74        <p><strong><em>NOTE:</em></strong> Most Objective C application projects use a main
75        nibfile called "MainMenu.nib", and if you use XCode to create
76        a new application project, it creates a nibfile with that
77        name. Apple's CurrencyConverter tutorial assumes that the
78        name of the main nibfile is "MainMenu.nib".</p>
80        <p>So, why do we tell you to use a different name? Clozure CL
81          has a main nibfile built into it, whose name is
82          "MainMenu.nib". Normally you don't see it, and don't even
83          need to know that it exists. But the Clozure CL
84          application-building tools create a new application by
85          copying resources from the Clozure CL application, so that
86          your new application has available to it all the built-in
87          Clozure CL tools. We ask you to name your nibfile
88          "CurrencyConverter.nib" so that it can coexist with the
89          Clozure CL main nibfile without causing any problems.</p>
91        <p>This difference between a Lisp project and an Objective C
92        project might be a little confusing at first. Just try to keep
93        in mind that whenever Apple's tutorial refers to the
94        "MainMenu.nib" file, it means the file we have just created
95        and named "CurrencyConverter.nib". In a Clozure CL project,
96        "MainMenu.nib" is the name of the main Lisp nibfile, not your
97        application's main nibfile.</p>
98      </div>
100      <div class="section-head">
101        <h2>Resize the Window</h2>
102      </div>
104      <p>Make the window smaller by dragging the bottom-right corner
105      of the window inward.</p>
107      <div class="inline-image">
108        <img src="../images/ibwin-tiger3.jpg"alt="" 
109             border='0'/>
110      </div>
112      <div class="section-head">
113        <h2>Change the Title of the Window</h2>
114      </div>
116      <p>InterfaceBuilder creates the initial window with the title
117      "Window". Change the title to the more appropriate "Currency
118      Converter":</p>
120      <ol>
121        <li><p>Click the Window object in the "Currency Converter"
122        window.</p>
123          <p><div class="inline-image">
124              <img src="../images/ibwin-tiger4.jpg"alt="" 
125                   border='0'/>
126            </div>
127        </p></li>
128        <li><p>Choose "Attributes" from the drop-down menu in the
129        Inspector window:</p>
130          <p><div class="inline-image">
131              <img src="../images/ibwin-tiger5.jpg"alt="" 
132                   border='0'/>
133            </div>
134        </p></li>
135        <li><p>Change the "Window Title" field to read "Currency Converter":</p>
136          <p><div class="inline-image">
137              <img src="../images/ibwin-tiger6.jpg"alt="" 
138                   border='0'/>
139            </div>
140        </p></li>
141      </ol>
143      <div class="section-head">
144        <h2>Add Text Fields</h2>
145      </div>
147      <p>In InterfaceBuilder's Palettes window, select the "Cocoa
148      Text" view, and find the NSTextView object:</p>
150      <div class="inline-image">
151        <img src="../images/ibwin-tiger7.jpg"alt="" 
152             border='0'/>
153      </div>
155      <p>Drag an NSTextView object and drop it into the "Currency
156      Converter" window:</p>
158      <div class="inline-image">
159        <img src="../images/ibwin-tiger8.jpg"alt="" 
160             border='0'/>
161      </div>
163    </div>
164  </body>
Note: See TracBrowser for help on using the repository browser.