IBM Smalltalk: Programmer's Reference

IBM Smalltalk: Programmer's Reference

IBM Smalltalk Programmer’s Reference Ve r s i o n 5.5 Note Before using this document, read the general information under “Notices” on page ix. May 2001 This edition applies to Version 5.5 of the VisualAge Smalltalk products, and to all subsequent releases and modifications until otherwise indicated in new editions. Make sure you are using the correct edition for the level of the product. The term “VisualAge,” as used in this publication, refers to the VisualAge Smalltalk product set. Portions of this book describe materials developed by Object Technology International Inc. of Ottawa, Ontario, Canada. Object Technology International Inc. is a subsidiary of the IBM® Corporation. If you have comments about the product or this document, address them to: IBM Corporation, Attn: IBM Smalltalk Group, 621-107 Hutton Street, Raleigh, NC 27606-6324. You can fax comments to (919) 828-9633. When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. © Copyright International Business Machines Corporation 1994, 2000. All rights reserved. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents Notices ...............ix Magnitude classes ............13 Trademarks..............ix Magnitudecomparing..........14 Association.............14 About this book ...........xi Character ..............14 Date................16 What this book includes ..........xi Time................16 Who this book is for ...........xi Number..............17 About this product or feature ........xi Integer...............18 Conventions used in this book ........xii Fraction ..............19 References...............xii Float................19 Common Language Data Types, Common ScaledDecimal ............20 Language Implementation, and Common Process Graphical classes ............20 Model...............xii Point...............20 Common File System ..........xiii Rectangle ..............21 CommonGraphics...........xiii Stream classes .............22 CommonWidgets...........xiii Accessing ..............23 CommonPrinting...........xiv Copying ..............23 Dynamic Data Exchange .........xiv Enumerating .............23 National Language Support........xiv Positioning .............24 Telluswhatyouthink..........xiv Reading..............24 Testing ...............24 Chapter 1. IBM Smalltalk overview . 1 Truncating..............24 Base subsystems .............1 Writing ...............24 Common Language Data Types .......1 Creatinginstances...........24 Common Language Implementation .....1 Support classes .............24 Common Process Model .........1 UndefinedObject............24 Common File System ..........1 Message and DirectedMessage .......25 CommonGraphics...........2 Block...............25 CommonWidgets...........2 Exception handling classes .........25 ExtendedWidgets...........2 ExceptionalEvent ...........25 DragandDrop............2 Signal ...............25 CommonPrinting...........2 Creatingnewexceptions.........25 Design intent ..............2 Signalinganexception..........26 Architecture ..............3 Handlingofexceptions.........26 Industry-standard support ..........3 ExceptionalEvent collections ........28 Platform support .............4 Completion blocks ...........29 Default exception handler ........30 Chapter 2. Common Language Data System exceptions ...........30 Types ................5 Examples of exception handling ......30 Object behavior .............6 Basicdependentsmechanism........6 Chapter 3. Common Language Behavior testing ............6 Implementation ...........33 Class identity testing ..........6 Behavior messages ............34 Copying ...............6 Class queries .............34 Printingandstoring...........6 Compiling ..............34 Performing ..............7 Creatinginstances...........34 Error handling.............7 Enumeration .............35 Primitive accessing ...........7 Instance accessing ...........35 Mutating..............7 Instance structure testing .........35 Testing object equality or identity ......7 Method accessing ...........35 Boolean classes .............7 Method adding and deleting .......36 Booleanmessages............7 Method queries ............36 Collection classes .............8 Classmessages.............36 Collection protocols ...........9 Class variable accessing .........37 Common collection protocols .......10 Instance variable accessing ........37 Unique collection protocol ........12 © Copyright IBM Corp. 1994, 2000 iii Shared pool accessing ..........37 Reading directory entries .........59 Class accessing ............37 Closing the directory descriptor ......61 Initializing and removing.........38 Using file streams ............61 Superclass accessing ..........38 File stream classes ...........61 Metaclassmessages............38 Opening and closing file streams ......61 Accessing ..............38 Reading and writing file streams ......62 Creating new classes ...........38 Characters versus bytes .........63 Creating fixed classes ..........39 Line delimiters ............63 Creating variable classes .........39 Using low-level file operations ........64 Creating variable byte classes .......39 Opening files .............64 Extended classes.............39 Closing file descriptors .........65 Multiple instance accessing ........40 Reading and writing data ........66 String converting ...........40 Changing the file offset .........66 Compiling and evaluating code........40 Other low-level operations ........67 Compiling ..............41 Mixing streams and file descriptors ......67 Evaluating..............41 Using access modes and flags with file streams 67 CompiledMethod ............42 Performing low-level file operations on streams 68 Accessing ..............42 Filelockingandsharemodes........68 Testing ...............42 Filelocking.............68 EmSystemConfiguration ..........42 Share modes .............70 Handlingerrors.............71 Chapter 4. Common Process Model . 45 Suppressing system error dialogs ......73 Creating a process ............45 Testing existence and obtaining other file properties 74 Suspending, resuming, and ending a process . 46 ObtainingaCfsStatinstance........74 Setting and modifying process priorities .....46 Mixing platform-specific and Common File System Synchronization using semaphore and delay . 47 operations...............76 Block evaluation methods ........48 Performing a platform-specific call with a Process-related block methods .......49 CfsFileDescriptor ...........76 Process methods............49 Converting a platform file descriptor into a ProcessorScheduler methods........50 CfsFileDescriptor ...........76 Delay class and instance methods ......50 Obtaining platform-specific error information . 76 Semaphore class and instance methods ....51 Chapter 6. Common Graphics .....79 Chapter 5. Common File System....53 X Window system graphics library compatibility . 79 Accessing the capabilities of the Common File CoreCommonGraphicsclasshierarchy.....80 System ................53 Seldom-used and abstract classes .......82 Basic file protocols ...........53 A simplified drawing process overview .....83 Streamprotocols............53 Beforedrawing............83 Portability protocols ..........53 Duringdrawing............83 Error handling protocols .........53 Afterdrawing............83 CfsConstants pool dictionary .......54 A simple example of the drawing process . 83 Basic classes .............54 CgConstants pool dictionary........83 Specifying file names and paths .......54 Usinggraphicscontexts..........84 Portable file names ...........54 Basic graphics context methods.......84 File system roots ...........55 Creatinggraphicscontexts........85 Pathseparators............55 Copying graphics contexts ........88 Managing files and directories ........55 Changing graphics contexts ........89 Current working directory ........55 Freeinggraphicscontexts.........89 Creating and removing directories ......55 Using graphics contexts with other drawables . 89 Deleting files .............56 Drawingoperations...........89 Renaming files ............56 Drawingpoints............90 Copying files .............56 Drawinglines............90 Startup directory ...........57 Drawingrectangles...........91 Obtainingvolumeinformation........57 Drawing polygons ...........92 Volumenameandtype.........57 Drawingarcsandcircles.........92 File names and directory path case .....57 Drawing pie slices and chords using filled arcs 93 Filenamelength............57 Usingfonts..............93 Volumes with different file name lengths . 58 A simplified view of the font process .....94 Searching directories ...........58 Querying the system for fonts .......95 Opening a directory for searching ......58 Loading fonts.............97 Assigning fonts for use in drawing operations 100 iv IBM Smalltalk: Programmer’s Reference String drawing operations with fonts ....101 The parent-child widget tree .......138 Releasing CgFonts and CgFontStructs from The widget lifecycle ..........138 memory..............102 Mapping and unmapping widgets .....140 Obtaining the current font from a graphics Managing and unmanaging widgets.....141 context..............102 Widgetresourcesandfunctions......141 Usingcursors.............103 CwConstants pool dictionary .......144 The process for using cursors .......103 Example code to create a widget tree ....144 Font cursors .............103 Widget event handling and callbacks ....146

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    550 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us