The News Toolkit Reference Manual
Total Page:16
File Type:pdf, Size:1020Kb
The NeWS Toolkit Reference Manual microsystems Sun Microsystems, Inc. 2500 Garcia Avenue Mountain View, CA 94043 Part No: 800-5543-10 Revision A, of March, 1991 The Sun logo, Sun Microsystems, NeWS, and Sun Workstation are registered trademarks of Sun Microsystems, Inc. Sun, Sun-2, Sun-3, Sun-4, Sun386i, SunInstall, SunOS, SunView, NFS, and SPARC are trademarks of Sun Microsystems, Inc. UNIX is a registered trademark of UNIX System Laboratories, Inc.. FrameMaker is a registered trademark of Frame Technology Corporation. OPEN LOOK is a trademark of AT&T. All other products or services mentioned in this document are identified by the trademarks or service marks of their respective companies or organizations. PostScript is a trademark of Adobe Systems Incorporated SmallTalk is a trademark of ParcPlace Systems Copyright © 1989, 1990 Sun Microsystems, Inc. - Printed in U.S.A. All rights reserved. No part of this work covered by copyright hereon may be reproduced in any form or by any means - graphic, electronic, or mechanical - including photocopying, recording, taping, or storage in an information retrieval system, without prior written permission of the copyright owner. RestrictedRestricted rights rights legend: legend: use, use, duplication, duplication, or disclosure or disclosure by the byU.S. the government U.S. government is subject is to subject restrictions to as set forthrestrictions in subparagraph set forth (c)(1)(ii)in subparagraph of the Rights (c)(1)(ii) in Technical of the Data Rights and inComputer Technical Software Data and clause Computer at DFARS 252.227-7013Software clause (October at DFARS 1988) and 52.227-7013 FAR 52.227-19 and (June in similar 1987). clauses in the FAR and NASA FAR Supplement. The Sun Graphical User Interface was 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. Contents 1. Preface. xxiii Intended purpose of this manual . xxiii What you need to know. xxiii How the Reference Manual is organized. xxiv TNT’s class tree. xxiv Mixin class defined . xxiv Rules followed for documenting superclass methods. xxiv How the API is represented . xxv What’s in the chapters . xxv Use of fonts . xxvii Subclassing issues. xxvii Strict subclass responsibility . xxviii Subclass responsibility. xxviii Subclasser methods . xxviii Utility methods. xxix Variables . xxix Demo methods . xxix Programming notes . xxx Modifying returned arrays . xxx Using super in overrides . xxx Getting the location of events . xxx Bibliography . xxxi NeWS . xxxi PostScript. xxxi Object-Oriented Programming and SmallTalk: . xxxi 2. TNT Class Hierarchy . xxxiii 3. Introduction . 1 Programming flexibility. 1 Thin wire . 2 Imaging PostScript . 2 The Classing system . 2 Where the classes live . 3 What TNT isn’t . 3 The architecture of a TNT application . 4 Server-side Architecture . 4 Client-side architecture . 8 The client-server split . 9 Memory management in TNT. 10 Creation and destruction of references . 10 Automatic cleanup of references . 11 References maintained by the Toolkit . 11 Cross-Object references within your application . 12 Process management in TNT. 13 iv The NeWS Toolkit Reference Manual — March 1991 The connection reader . 13 The local event manager . 14 The global event manager . 14 Starting and quitting applications. 15 Painting in TNT . 16 The Canvas/Region hierarchy . 16 4. ClassBag . 17 Creation . 17 Activation and deactivation . 18 Bag clients . 18 Destruction . 19 Miscellaneous . 20 Subclasser methods . 20 Mouse tracking for regions in bags . 20 Menus. 21 5. ClassBorderBag . 23 Border bag’s clients . 23 Adding clients. 26 Positioning clients. 26 Geometry . 27 Layout . 28 Menus and tracking . 28 6. Buttons . 29 ClassButtons . 30 v Creation . 30 Abbreviated buttons . 30 Ability to interact with buttons . 30 Default . 31 Justification . 31 Notification . 31 Managing references between controls and other objects 32 ClassMenuButtons . 32 7. ClassCanvas . 35 Creation . 35 Canvas appearance. 36 Colors. 36 Painting . 38 Fonts. 40 Cursors . 41 The canvas tree . 41 Geometry . 43 Validation. 44 Ability to accept user input . 46 Activation and deactivation . 46 ClassEventMgr . 48 Global event manager . 48 Local event manager . 49 Creation . ..