Openstep Development Tools
Total Page:16
File Type:pdf, Size:1020Kb
OpenStep Development Tools 2550 Garcia Avenue Mountain View, CA 94043 U.S.A. A Sun Microsystems, Inc. Business 1996 Sun Microsystems, Inc. 2550 Garcia Avenue, Mountain View, California 94043-1100 U.S.A. All rights reserved. Portions Copyright 1995 NeXT Computer, Inc. All rights reserved. This product or document is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation. No part of this product or document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Portions of this product may be derived from the UNIX® system, licensed from UNIX System Laboratories, Inc., a wholly owned subsidiary of Novell, Inc., and from the Berkeley 4.3 BSD system, licensed from the University of California. Third-party font software, including font technology in this product, is protected by copyright and licensed from Sun's suppliers. This product incorporates technology licensed from Object Design, Inc. RESTRICTED RIGHTS LEGEND: Use, duplication, or disclosure by the government is subject to restrictions as set forth in subparagraph (c) (1) (ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR 52.227- 19. The product described in this manual may be protected by one or more U.S. patents, foreign patents, or pending applications. TRADEMARKS Sun, Sun Microsystems, the Sun logo, SunSoft, the SunSoft logo, Solaris, SunOS, and OpenWindows are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. UNIX is a registered trademark in the United States and other countries, exclusively licensed through X/Open Company, Ltd. OPEN LOOK is a registered trademark of Novell, Inc. PostScript and Display PostScript are trademarks of Adobe Systems, Inc. Object Design is a trademark and the Object Design logo is a registered trademark of Object Design, Inc. OpenStep, NeXT, the NeXT logo, NEXTSTEP, the NEXTSTEP logo, Application Kit, Foundation Kit, Project Builder, and Workspace Manager are trademarks of NeXT Computer, Inc. Unicode is a trademark of Unicode, Inc. VT100 is a trademark of Digital Equipment Corporation. All other product names mentioned herein are the trademarks of their respective owners. All SPARC trademarks are trademarks or registered trademarks of SPARC International, Inc. in the United States and other countries. SPARCcenter, SPARCcluster, SPARCCompiler, SPARCdesign, SPARC811, SPARCengine, SPARCprinter, SPARCserver, SPARCstation, SPARCstorage, SPARCworks, microSPARC-11, and UltraSPARC are licensed exclusively to Sun Microsystems, Inc. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc. The OPEN LOOK® and Sun™ Graphical User Interfaces were developed by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the pioneering efforts of Xerox in researching and developing the concept of visual or graphical user interfaces for the computer industry. Sun holds a non-exclusive license from Xerox to the Xerox Graphical User Interface, which license also covers Sun's licensees who implement OPEN LOOK GUIs and otherwise comply with Sun's written license agreements. X Window System is a product of X Consortium, Inc. THIS PUBLICATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THIS PUBLICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THE PUBLICATION. SUN MICROSYSTEMS, INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THIS PUBLICATION AT ANY TIME. Please Recycle Contents 1. Introduction . 1-1 Putting Together an OpenStep Application . 1-2 Designing Your Application. 1-2 Creating a Project. 1-2 Writing Code for Your Application . 1-3 Connecting Objects with Interface Builder. 1-3 Adding Other Resource Files . 1-4 Choosing Document Extensions for Your Application . 1-4 Compiling Your Program . 1-4 Debugging Your Program. 1-5 Adding Help to Your Application . 1-5 Translate Your User Interface . 1-5 Making Your Application Available to Users. 1-6 2. Using Project Builder . 2-1 Creating and Maintaining Projects in Project Builder . 2-3 iii Creating a New Project . 2-3 Opening an Existing Project . 2-5 Opening and Converting Older Project Types . 2-6 Creating a New Subproject. 2-7 Setting Project Attributes . 2-8 Application Attributes. 2-9 Subproject Attributes. 2-11 Bundle Attributes. 2-11 Tool Attributes . 2-12 Palette Attributes . 2-13 Library Attributes . 2-14 Managing Project Files . 2-14 Adding Files to a Project . 2-17 File Display Shortcuts . 2-17 Building the Project . 2-18 Build Targets . 2-23 The Preamble and Postamble Files . 2-24 Defining User-configurable Macros for a Project with IDL Interfaces . 2-27 Setting Preferences. 2-29 Build Defaults Controls . 2-29 Tools Controls . 2-29 Sounds Controls . 2-31 Build Service Controls . 2-31 iv OpenStep Development Tools—September 1996 Save Options Controls . 2-31 Running and Debugging an Application . 2-32 Running. 2-32 Debugging . 2-32 Project Builder Command Reference. 2-33 Commands in the Project Menu. 2-33 Commands in the Files Menu . 2-34 3. Working with Interface Builder . 3-1 An Orientation . 3-3 Building an Application with Interface Builder. 3-4 Specifying Object Attributes. 3-4 Interconnecting Objects. 3-5 Adding Code to Your Application. 3-5 Composing the Interface . 3-6 Opening a Nib File. 3-6 When Interface Builder Starts . 3-8 The Palette Window. 3-9 The Interface Window . 3-9 The Nib File Window. 3-10 The Inspector Panel . 3-21 Creating a Nib File. 3-22 Saving the Nib File . 3-23 What Is in a Nib File . 3-24 Archived Objects . 3-24 Contents v Sounds and Images . 3-25 Class References . 3-25 Connection Information . 3-26 When You Load a Nib File . 3-27 Using the Palettes . 3-27 The Menus Palette . 3-28 The Views Palette . 3-28 The TextViews Palette . 3-30 The Windows Palette . 3-30 Adding an Object from a Palette to Your Interface . 3-31 Placing Interface Objects. 3-33 Selecting Multiple Objects . 3-34 Where Palette Objects Go . 3-34 Sizing Windows and Panels . 3-36 Initializing Text . 3-38 Sizing Interface Objects. 3-39 Positioning and Sizing Precisely . 3-40 Duplicating Objects . 3-42 Moving Objects to Other Windows . 3-43 Copying Objects to Other Interfaces . 3-44 Arranging Objects . 3-45 Using the Alignment Panel . 3-45 Making Columns and Rows of Objects . 3-48 Removing Objects . 3-49 vi OpenStep Development Tools—September 1996 The Coordinate System in Interface Builder. 3-49 OpenStep's Basic UI Design Philosophy. 3-51 Make It Consistent . 3-51 Make it Feel Natural . 3-51 Put the User in Charge. 3-51 Focus on the Mouse . 3-52 Making Interface Objects the Same Size . 3-52 Shrinking Objects to their Minimum Size. 3-54 Grouping Objects. 3-55 Layering Objects . 3-57 Creating Matrices of Objects. 3-58 Creating Menus . 3-60 Deleting.