You are on page 1of 1010

ð

SK8 Object Reference


Version 0.9
CONFIDENTIAL

ð
Brought to you by the SK8 Development Team.

©1995 Apple Computer, Inc. All rights reserved. No part of this publication may be
reproduced, transmitted, transcribed, stored in a retrieval system, or translated into
any language in any form by any means without the written permission of Apple
Computer, Inc.
ð Apple Computer, Inc. LIMITED WARRANTY ON MEDIA AND
© 1995, Apple Computer, Inc. REPLACEMENT
All rights reserved. If you discover physical defects in the
No part of this publication or the manual or in the media on which a software
software described in it may be product is distributed, APDA will replace
reproduced, stored in a retrieval the media or manual at no charge to you
system, or transmitted, in any form or provided you return the item to be replaced
by any means, mechanical, electronic, with proof of purchase to APDA.
photocopying, recording, or otherwise, ALL IMPLIED WARRANTIES ON THIS
without prior written permission of MANUAL, INCLUDING IMPLIED
Apple Computer, Inc., except in the WARRANTIES OF MERCHANTABILITY
normal use of the software or to make a AND FITNESS FOR A PARTICULAR
backup copy of the software. The same PURPOSE, ARE LIMITED IN DURATION
proprietary and copyright notices must TO NINETY (90) DAYS FROM THE DATE
be affixed to any permitted copies as OF THE ORIGINAL RETAIL PURCHASE
were affixed to the original. This OF THIS PRODUCT.
exception does not allow copies to be
made for others, whether or not sold, Even though Apple has reviewed this
but all of the material purchased (with manual, APPLE MAKES NO WARRANTY
all backup copies) may be sold, given, OR REPRESENTATION, EITHER EXPRESS
or loaned to another person. Under the OR IMPLIED, WITH RESPECT TO THIS
law, copying includes translating into MANUAL, ITS QUALITY, ACCURACY,
another language or format. You may MERCHANTABILITY, OR FITNESS FOR A
use the software on any computer PARTICULAR PURPOSE. AS A RESULT,
owned by you, but extra copies cannot THIS MANUAL IS SOLD “AS IS,” AND
be made for this purpose. YOU, THE PURCHASER, ARE ASSUMING
THE ENTIRE RISK AS TO ITS QUALITY
Printed in the United States of America.
AND ACCURACY.
The Apple logo is a registered
trademark of Apple Computer, Inc. IN NO EVENT WILL APPLE BE LIABLE
Use of the “keyboard” Apple logo FOR DIRECT, INDIRECT, SPECIAL,
(Option-Shift-K) for commercial INCIDENTAL, OR CONSEQUENTIAL
purposes without the prior written DAMAGES RESULTING FROM ANY
consent of Apple may constitute DEFECT OR INACCURACY IN THIS
trademark infringement and unfair MANUAL, even if advised of the possibility
competition in violation of federal and of such damages.
state laws. THE WARRANTY AND REMEDIES SET
No licenses, express or implied, are FORTH ABOVE ARE EXCLUSIVE AND IN
granted with respect to any of the LIEU OF ALL OTHERS, ORAL OR
technology described in this book. WRITTEN, EXPRESS OR IMPLIED. No
Apple retains all intellectual property Apple dealer, agent, or employee is
rights associated with the technology authorized to make any modification,
described in this book. This book is extension, or addition to this warranty.
intended to assist application
Some states do not allow the exclusion or
developers to develop applications only
limitation of implied warranties or liability
for Apple Newton computers.
for incidental or consequential damages, so
Apple Computer, Inc. the above limitation or exclusion may not
20525 Mariani Avenue apply to you. This warranty gives you
Cupertino, CA 95014 specific legal rights, and you may also have
408-996-1010 other rights which vary from state to state.
Apple, the Apple logo, APDA,
LaserWriter, the light bulb logo,
Macintosh, and Newton are trademarks
of Apple Computer, Inc., registered in
the United States and other countries.
Newton ToolKit and QuickDraw are
trademarks of Apple Computer, Inc.
Simultaneously published in the United
States and Canada.

©1995 Apple Computer, Inc. 5/7/95


ð

Table of Contents

Object Reference ..............................................................................................................1


Abort ...............................................................................................................................1
AbortCondition ...............................................................................................................2
AbstractClock .................................................................................................................3
Actor ...............................................................................................................................5
ActorCollection ..............................................................................................................102
AETarget ........................................................................................................................103
AnimatedClock ...............................................................................................................104
AnimatedCursor ..............................................................................................................105
AppleEvent .....................................................................................................................107
AppleEventError .............................................................................................................112
AppleEventReceiver .......................................................................................................112
AppleScript .....................................................................................................................114
AppleScriptResult ...........................................................................................................117
AppleTalkError ...............................................................................................................118
ArgumentTypeMismatchError .......................................................................................118
ArithmeticError ..............................................................................................................119
ArithmeticOverflowError ...............................................................................................120
Arrow ..............................................................................................................................121
BevelRenderer ................................................................................................................124
BigFloat ..........................................................................................................................127
BigInteger .......................................................................................................................128
BringUpHandler .............................................................................................................128
BrowserComponent ........................................................................................................129
BrowserMenuBar ............................................................................................................132
BrowserPaper ..................................................................................................................133
BWPattern ......................................................................................................................133
ByteStream .....................................................................................................................136
CantChangeConstantError ..............................................................................................136
Character .........................................................................................................................137
CheckBox .......................................................................................................................138
ChooseResponse .............................................................................................................142
clipBoard ........................................................................................................................143
Clock ...............................................................................................................................149
ClockError ......................................................................................................................155
CoercionError .................................................................................................................155

Page iii
ð

Collection ....................................................................................................................... 157


ColorCursorRSRC ......................................................................................................... 175
ColorPattern ................................................................................................................... 175
ColorPicker .................................................................................................................... 178
CompilationError ........................................................................................................... 179
Complex ......................................................................................................................... 179
ComplexGradient ........................................................................................................... 180
ComplexRGBColor ........................................................................................................ 185
ComponentManagerError .............................................................................................. 189
Condition ....................................................................................................................... 189
ConditionResponse ........................................................................................................ 190
ConditionSystemError ................................................................................................... 192
Connector ....................................................................................................................... 193
ConstantSheet ................................................................................................................ 197
ConstantSheetPicker ...................................................................................................... 197
CursorRSRC .................................................................................................................. 197
DataObject ..................................................................................................................... 198
DateTime ........................................................................................................................ 198
Device ............................................................................................................................ 210
DialogBox ...................................................................................................................... 211
DialogBoxButton ........................................................................................................... 211
DialogBoxCancelButton ................................................................................................ 212
DialogBoxDisplayEditText ............................................................................................ 213
DialogBoxDisplayRectangle .......................................................................................... 213
DialogBoxEditText ........................................................................................................ 214
DialogBoxHighlightedButton ........................................................................................ 214
DialogBoxLabel ............................................................................................................. 215
directionalConnector ...................................................................................................... 215
DirectoryError ................................................................................................................ 216
DirectoryNickname ........................................................................................................ 216
DiskError ........................................................................................................................ 217
DisplayErrorMessage ..................................................................................................... 218
DivisionByZeroError ..................................................................................................... 219
DrawTool ....................................................................................................................... 220
DrawToolPalette ............................................................................................................ 223
EditMenu ........................................................................................................................ 224
EditText .......................................................................................................................... 224
EditTextCollection ......................................................................................................... 246
Effect .............................................................................................................................. 246
EmptyAppleScriptResult ............................................................................................... 247
EndOfFileError .............................................................................................................. 247

Page iv
ð

EnumeratedType .............................................................................................................247
Error ................................................................................................................................248
ErrorColor .......................................................................................................................249
EventMode ......................................................................................................................250
EventModeError .............................................................................................................254
ExitModeWithError ........................................................................................................255
File ..................................................................................................................................256
FileChooser .....................................................................................................................273
FileError ..........................................................................................................................278
FileList ............................................................................................................................279
FileMemoryFullError .....................................................................................................279
FileMenu .........................................................................................................................279
FileName ........................................................................................................................280
FileNotFoundError .........................................................................................................281
FilePopUp .......................................................................................................................281
FileSystemError ..............................................................................................................282
Float ................................................................................................................................282
Font .................................................................................................................................283
ForeignDeftrap ................................................................................................................284
ForeignMemory ..............................................................................................................285
Function ..........................................................................................................................286
FunctionSheet .................................................................................................................287
FunctionSheetPicker .......................................................................................................287
GeneralError ...................................................................................................................287
GeneralProgrammaticError ............................................................................................289
GetFromUserButton .......................................................................................................289
GetObjectField ................................................................................................................291
Gradient ..........................................................................................................................294
Graphic ...........................................................................................................................298
halo .................................................................................................................................298
Handler ...........................................................................................................................300
HandlerDataRect ............................................................................................................301
HandlerList .....................................................................................................................302
HandlerPicker .................................................................................................................303
HandlerSheet ..................................................................................................................303
HandlerSheetPicker ........................................................................................................303
HandlerViewer ................................................................................................................303
HandlerViewerText ........................................................................................................304
HandlerWatchingComponent .........................................................................................304
Hatch ...............................................................................................................................305
HierarchicalObjectList ....................................................................................................309

Page v
ð

HierarchicalObjectPicker ............................................................................................... 310


HierarchicalPicker .......................................................................................................... 312
HierarchicalPickerItem .................................................................................................. 314
Highlighted .................................................................................................................... 316
IconRSRC ...................................................................................................................... 317
IconTextPicker ............................................................................................................... 319
IllegalFilenameError ...................................................................................................... 323
ImageCompressionError ................................................................................................ 323
ImageRenderer ............................................................................................................... 324
IncorrectArgumentsError ............................................................................................... 331
IncorrectSubscriptsError ................................................................................................ 333
IndexOutOfBoundsError ................................................................................................ 334
IndirectText .................................................................................................................... 335
InputOutputPort ............................................................................................................. 341
InputPort ........................................................................................................................ 344
Integer ............................................................................................................................ 346
IODriverError ................................................................................................................ 346
Keyboard ........................................................................................................................ 346
Label .............................................................................................................................. 347
Line ................................................................................................................................ 350
linearTextPicker ............................................................................................................. 350
LineSegment .................................................................................................................. 354
LogErrorMessage ........................................................................................................... 364
MacAlertBox .................................................................................................................. 365
MacAnimation ............................................................................................................... 366
MacBarberPole .............................................................................................................. 369
MacButton ...................................................................................................................... 369
MacCheckBox ................................................................................................................ 371
MacDialog ...................................................................................................................... 371
MacFinderArrow ............................................................................................................ 372
MacMenuItem ................................................................................................................ 374
MacModalDialog ........................................................................................................... 374
MacMovableModalDialog ............................................................................................. 375
MacPopupMenu ............................................................................................................. 375
MacProgressIndicator .................................................................................................... 375
MacRadioButton ............................................................................................................ 377
MacRoundIndicator ....................................................................................................... 378
MacScrollBar ................................................................................................................. 378
MacScrollingList ............................................................................................................ 380
MacWidget ..................................................................................................................... 381
mask ............................................................................................................................... 382

Page vi
ð

MaskedActor ..................................................................................................................383
MaybeOpenProject .........................................................................................................385
Media ..............................................................................................................................386
MemHandle ....................................................................................................................390
MemoryFullError ............................................................................................................390
MemoryManagerError ....................................................................................................390
MemPointer ....................................................................................................................391
Menu ...............................................................................................................................391
MenuBar .........................................................................................................................408
MenubarCollection .........................................................................................................414
MenuBarEditorPicker .....................................................................................................415
MenuCollection ..............................................................................................................417
MenuEditorPicker ...........................................................................................................417
MenuForConPickers .......................................................................................................419
MenuForFunPickers .......................................................................................................419
MenuForHandlerPickers .................................................................................................420
MenuForHierarchicalObjectPickers ...............................................................................421
MenuForMenuEditorPickers ..........................................................................................421
MenuForObjectPickers ...................................................................................................423
MenuForPropertyPickers ................................................................................................424
MenuForValueEditorPickers ..........................................................................................425
MenuForVarPickers ........................................................................................................426
MenuItem ........................................................................................................................426
MenuManagerError ........................................................................................................435
MenuSpacer ....................................................................................................................436
MinutesClock ..................................................................................................................436
MixinForObjectPickers ..................................................................................................436
MixinForObjectPiles ......................................................................................................439
MixinForProjectDataPickers ..........................................................................................440
MixinForPropertyHandlerPickers ..................................................................................443
Monitor ...........................................................................................................................448
Mouse .............................................................................................................................451
MovieControllerError .....................................................................................................453
MovieDataHandlerError .................................................................................................453
MovieError .....................................................................................................................453
MovieRectangle ..............................................................................................................453
MovieSequenceGrabberError .........................................................................................454
MultiLinePicker ..............................................................................................................454
MultiObjectStateCheckbox ............................................................................................456
MultiRenderer .................................................................................................................459
NameField ......................................................................................................................461

Page vii
ð

NonNegativeInteger ....................................................................................................... 461


NoResponse ................................................................................................................... 462
NotAHandlerError ......................................................................................................... 463
Number .......................................................................................................................... 464
NumberMemoryFullError .............................................................................................. 464
NumberPropertyEditor ................................................................................................... 464
Object ............................................................................................................................. 465
ObjectDataRect .............................................................................................................. 497
ObjectList ....................................................................................................................... 499
ObjectPicker ................................................................................................................... 499
ObjectPile ....................................................................................................................... 499
ObjectPilePicker ............................................................................................................ 500
ObjectTable .................................................................................................................... 500
OSHeapFullError ........................................................................................................... 500
OutputPort ...................................................................................................................... 501
Oval ................................................................................................................................ 503
Paragraph ....................................................................................................................... 505
pen .................................................................................................................................. 505
Picker ............................................................................................................................. 516
PickerCollection ............................................................................................................. 531
PickerMenu .................................................................................................................... 531
PickerMenuItem ............................................................................................................. 534
PickerMenuItemSpacer .................................................................................................. 535
PixelMap ........................................................................................................................ 535
Pointer ............................................................................................................................ 537
Polygon .......................................................................................................................... 538
Port ................................................................................................................................. 548
PositiveInteger ............................................................................................................... 554
PPCToolboxError .......................................................................................................... 555
ProgrammaticError ........................................................................................................ 555
project ............................................................................................................................ 555
ProjectDataPicker .......................................................................................................... 567
ProjectDataSheet ............................................................................................................ 567
ProjectDataSheetPicker .................................................................................................. 567
ProjectImproperlyClosedError ....................................................................................... 568
PropertyControlPanel ..................................................................................................... 568
PropertyDataRect ........................................................................................................... 572
PropertyHandlerList ....................................................................................................... 574
PropertyHandlerPicker ................................................................................................... 574
PropertyHandlerSheet .................................................................................................... 574
PropertyHandlerSheetPicker .......................................................................................... 575

Page viii
ð

PropertyList ....................................................................................................................575
PropertyPicker ................................................................................................................575
PropertySheet ..................................................................................................................575
PropertySheetPicker .......................................................................................................576
PropertyTypeMismatchError ..........................................................................................576
Proxy ...............................................................................................................................577
QDPicture .......................................................................................................................578
QDPictureToPictTranslator ............................................................................................581
QueryField ......................................................................................................................581
QuickTimeCallBack .......................................................................................................583
QuickTimeCallBackAtExtremes ....................................................................................588
QuickTimeCallBackAtRate ............................................................................................589
QuickTimeCallBackAtTime ...........................................................................................590
QuickTimeCallBackAtTimeJump ..................................................................................592
QuickTimeCallBackForRenderer ...................................................................................592
QuickTimeMedia ............................................................................................................593
QuickTimeMovie ............................................................................................................594
QuickTimeRenderer .......................................................................................................621
QuickTimeTimeBase ......................................................................................................656
QuickTimeTrack .............................................................................................................663
QuickTimeTrackCollection ............................................................................................666
RadioButton ....................................................................................................................666
Real .................................................................................................................................670
RealTimeClock ...............................................................................................................670
Rectangle ........................................................................................................................673
Renderer ..........................................................................................................................677
ResourceChooser ............................................................................................................681
ResourceError .................................................................................................................682
RGBColor .......................................................................................................................683
RootDirectory .................................................................................................................685
RoundRect ......................................................................................................................685
safeInputPort ...................................................................................................................688
safeOutputPort ................................................................................................................689
ScrapManagerError ........................................................................................................689
ScriptEditorWindow .......................................................................................................689
ScriptEditText .................................................................................................................696
ScriptExpression .............................................................................................................713
ScriptSyntaxError ...........................................................................................................714
Scroller ............................................................................................................................715
scrollerArrow ..................................................................................................................724
ScrollerBody ...................................................................................................................724

Page ix
ð

ScrollerDownArrow ....................................................................................................... 725


ScrollerThumb ............................................................................................................... 726
ScrollerUpArrow ............................................................................................................ 727
SecondsClock ................................................................................................................. 729
SelectByRowTablePickerAddOn .................................................................................. 729
SelectionDots ................................................................................................................. 731
SelectionTool ................................................................................................................. 733
SerialPortError ............................................................................................................... 736
SimpleMenubar .............................................................................................................. 736
SimplePropertyEditor .................................................................................................... 736
SK8 ................................................................................................................................ 738
sk8Clipboard .................................................................................................................. 739
SK8Directory ................................................................................................................. 739
SK8HeapFullError ......................................................................................................... 740
SketchRenderer .............................................................................................................. 740
SlaveClock ..................................................................................................................... 743
Slider .............................................................................................................................. 744
SmallFloat ...................................................................................................................... 744
SmallInteger ................................................................................................................... 745
SoundManagerError ....................................................................................................... 745
SoundRSRC ................................................................................................................... 745
splitter ............................................................................................................................ 747
StackOverflowError ....................................................................................................... 751
StackWatcher ................................................................................................................. 752
Stage ............................................................................................................................... 754
StorageDevice ................................................................................................................ 764
Stream ............................................................................................................................ 766
StyledPicker ................................................................................................................... 767
SwatchRenderer ............................................................................................................. 769
Symbol ........................................................................................................................... 771
System ............................................................................................................................ 772
SystemClock .................................................................................................................. 780
SystemError ................................................................................................................... 780
Table .............................................................................................................................. 781
TablePair ........................................................................................................................ 782
TablePicker .................................................................................................................... 782
TablePickerEditor .......................................................................................................... 808
TablePickerEditorAddOn .............................................................................................. 809
tbSketchRenderer ........................................................................................................... 811
Text ................................................................................................................................ 813
TextChunk ...................................................................................................................... 819

Page x
ð

textField ..........................................................................................................................820
textList ............................................................................................................................822
TextStream ......................................................................................................................832
ThisApplicationAETarget ..............................................................................................837
Today ..............................................................................................................................837
translator .........................................................................................................................838
TwoByNBrowserPicker ..................................................................................................844
TwoNumberPropertyEditor ............................................................................................846
TypeMismatchError ........................................................................................................847
TypeTable .......................................................................................................................849
UI ....................................................................................................................................849
uiRectangleInBevel ........................................................................................................849
uiRectangleOutBevel ......................................................................................................849
UnboundVariableError ...................................................................................................850
UndefinedHandlerError ..................................................................................................851
UndoableSetLog .............................................................................................................852
UnknownError ................................................................................................................854
ValueEditor .....................................................................................................................854
ValueEditorPicker ..........................................................................................................855
ValueText .......................................................................................................................857
VariableSheet ..................................................................................................................858
VariableSheetPicker .......................................................................................................859
VirtualType .....................................................................................................................859
VisualEffect ....................................................................................................................860
WindowsMenu ................................................................................................................860
Word ...............................................................................................................................860
ZoomIn ...........................................................................................................................861

Functions ...........................................................................................................................863

Constants ..........................................................................................................................963

Global Variables ...............................................................................................................969

Page xi
ð

Page xii
i n v o k e o f A b o r t

Object Reference

Abort
(a ConditionResponse)

Invoking this response aborts the current event-processing, dropping back down into the current event
loop.
If the currentCondition is an AbortCondition and its exitBreak property is True , it also aborts
the current event loop, dropping back down into the event loop below it.
This response is always invokable.

See Also
abortEvent , abortBreak , abortError, AbortCondition , ConditionResponse , the Condition
System section of the User Guide's SK8Script Language chapter

Handlers of Abort

invoke of Abort
invoke me
This handler aborts the current event-processing, dropping back down into the current
event loop.
If the currentCondition is an AbortCondition and its exitBreak property is
True , it also aborts the current event loop, dropping back down into the event loop below
it.

me (an Abort)

See Also

abortEvent , abortBreak , abortError, ConditionResponse

Page 1
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w r i t e O b j e c t o f A b o r t

writeObject of Abort
writeObject me, thestream, rereadably
If rereadably is True , this just does the inherited writeObject behavior. Otherwise it
writes a description of what the Abort response will do when invoked.

me (an Abort)
theStream
rereadably

See Also

ConditionResponse , writeObject of Object

AbortCondition
(a Condition)

Properties of AbortCondition

exitbreak of AbortCondition

Getter
get the exitBreak of me

Setter
set the exitbreak of me
to NewValue

handlerargument of AbortCondition

Getter
get the handlerArgument of me

Page 2
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p o s t a b o r t h a n d l e r o f A b o r t C o n d i t i o n

Setter
set the handlerargument of me
to NewValue

postaborthandler of AbortCondition

Getter
get the postAbortHandler of me

Setter
set the postaborthandler of me
to NewValue

AbstractClock
(an Object)

This object is the root of the SK8 clock hierarchy. It encapsulates the functionality required for objects that
orchestrate time lines. It has one notorious child: Clock .
All the handlers defined on AbstractClock do nothing. They become meaningfull in some of its
descendants. The documentation of this object just explains what these handlers mean.

See Also
Clock and its knownChildren .

Handlers of AbstractClock

pause of AbstractClock
pause me
The command issued to pause the simulation/animation that this clock controls.

me (a AbstractClock)

Page 3
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p l a y o f A b s t r a c t C l o c k

play of AbstractClock
play me
Command issued to play any simulations that are tied to this clock.

me (a AbstractClock)

start of AbstractClock
start me
This is the command issued to start running the clock.

me (a AbstractClock)

started of AbstractClock
started me
This handler is called when the clock starts running.

me (a AbstractClock)

stop of AbstractClock
stop me
This is the command that is issued to make the clock stop running.

me (a AbstractClock)

stopped of AbstractClock
stopped me
Returns True if the clock is not currently running.

me (a AbstractClock)

tick of AbstractClock
tick me

Page 4
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t i c k o f A b s t r a c t C l o c k

This handler is called each time the clock ticks and it marks the unit of time in the clock's
logical time scale.

me (a AbstractClock)

Actor
(an ActorCollection, Graphic)

An actor is a graphical object: it has a geometry and can be displayed on the screen. In fact, every SK8
object you see on the Stage is a descendant of Actor.
The actor's geometry is defined by three masks (or regions): the boundsRegion , the fillRegion and
the frameRegion . The boundsRegion is the space the whole actor takes. The frameRegion is the
perimeter of the bounds. Its size is specified by the frameSize property. The frameRegion can be
empty (when the framesize = {0,0} ). The fillRegion is the space inside the frame, or more
generally, the difference between the bounds and the frame.
Each actor has three handlers which compute these masks: makeBoundsRegion , makeFillRegion
and makeFrameRegion . If you want the implement a new geometry, these handlers will have to be
redefined.
Most of SK8 users, however, will never need to do this. The actor's size and location are manipulated
using the boundsRect property. The boundsRect specifies a rectangle within which the actor's bounds
will be inscribed. The boundsRect is represented as a list of 4 numbers of the form {left, top,
right, bottom} .

The actor's masks are also used for drawing. The frameRegion is rendered with the actor's
frameColor. The fillRegion is rendered with the actor's fillColor. Any actors that are contained
by an actor are drawn clipped to the fillRegion .
Actor is the most prolific child of Graphic with numerous children of its own.

Note: Actors carry with them a lot of information that is required to display them graphically. Thus, you
should only use actors for objects that are inherently graphical.◆

Page 5
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a c c e p t s d r o p s o f A c t o r

Properties of Actor

acceptsdrops of Actor
This property determines whether the actor requests drop events from SK8. If True (the
default), then SK8 will send a drop event to the actor whenever another actor is dropped
onto it (typically at the end of a drag process).

Getter
get the acceptsDrops of me

me (an Actor)

Setter
set the acceptsdrops of me
to NewValue

me (an Actor)
to (a boolean): Whether to tell the actor to accept drop events.

Example
Let us build a Disposer: a rectangle that removes from the Stage whatever is dropped on
it (it sets the container of the dropped actor to false ).
The Disposer can be switched off by setting its acceptsDrops property to False . We
will provided a visual indication of the status of our Disposer: when it is ON we will set
its text to "Disposer On!" and paint it Red, when it is OFF we will set its text to "Out For
Lunch" and paint it White.
We make the Disposer:
new rectangle with objectName "Disposer"
The first thing we need to do is define its set acceptDrops handler to change its
appearance.

Page 6
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a u t o h i g h l i g h t o f A c t o r

on set acceptsDrops of me (a Disposer) to newValue


-- do inherited to set the property!
do inherited
-- now change its appearance.
if newValue then
set my fillcolor to Red
set my text to "Disposer On!"
else
set my fillcolor to White
set my text to "Out For Lunch"
end if
end set acceptsDrops
Finally, we define the dropped handler of the Disposer to set the container of whatever is
dropped into it to False . Note that this handler will only be called by the system when
the acceptsDrops of the Disposer is true .
on dropped of me (a Disposer), dropee
set the container of dropee to False
end drop
To test our object, we can put it on the Stage , set its acceptsDrops property to True
and drop other actors into it.

See Also

drop , dropped and drag handlers.

autohighlight of Actor
The autohighlight property determines whether an actor will get highlighted (its set
highlight handler will be called) when the mouse goes down on it. The default is
False .

Getter
get the autoHighlight of me

me (an Actor)

Setter
set the autohighlight of me
to NewValue

me (an Actor)
to (a boolean): Whether to make this actor autohighlight when clicked on.

Page 7
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a u t o t a b o f A c t o r

See Also

set highlight , highlight .

autotab of Actor
The autoTab property controls the function of the tab key when an actor is the
keyTarget of its window. If the autotab of the actor is True , pressing the tab sets the
keyTarget of its window to the next actor in the Actor's container whose autotab is
True .

The tabToNextActor handler is called to find the next actor to become the keyTarget .

Getter
get the autoTab of me

me (an Actor)

Setter
set the autotab of me
to NewValue

me (an Actor)
to (a boolean): Whether to make this actor autotabable.

See Also

tabToNextActor.

bottom of Actor
The bottom of the actor's boundsRect . This is a virtual property computed from the
boundsRect .

Getter
get the bottom of me
with physical

me (an Actor)
[with physical] (a boolean): If True , the bottom point is returned in physical
coordinates.

Page 8
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b o t t o m o f A c t o r

Setter
set the bottom of me
with physical
with relative
with resizing
to NewValue

me (an Actor)
[with physical] (a boolean): If True , assumes that the bottom is specified in
physical coordinates.
[with relative] (a boolean): If True , the current bottom of the Actor is
changed by the amount specified.
[with resizing] (a boolean): If True (the default), setting the bottom of the
actor constrains all other boundsRect positions to remain as they are.
The actor will thus be resized. If False , the actor will move to make its
boundsRect coincide with the new bottom position.
to (a Number)

Example
Consider a Rectangle called StickyRectangle . This rectangle has a property called
"hostages" in which it keeps a list of actors whose bottoms are constrained to being at the
same v coordinate as StickyRectangle 's top . StickyRectangle has another
property called "resizing" that specifies whether the hostages will be resized to conform to
the constraint. If it is False , the hostages are just moved.
We need to redefine stickyRectangle 's moved and resized handlers to make sure
that whenever it moves, the bottom of every hostage is kept in line.
Notice that if StickyRectangle 's resizing property is False , the hostages's bottom is
changed without resizing, in effect moving the hostages as desired.
on moved of me (a StickyRectangle)
-- Important to do inherited to keep a number of things
-- in synch!
do inherited
set myTop to my top
repeat with poorHostage in my hostages
set the bottom of poorHostage
with resizing my resizing to myTop
end repeat
end moved

See Also

setLocation and setBoundsRect , boundsRect , left , top , right , h , v, and


location .

Page 9
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b o u n d e d b y c o n t e n t s o f A c t o r

boundedbycontents of Actor
If an actor's boundedByContents property is True , its boundsRect is constrained to be
the union of the boundsRect of all of its direct contents. In other words, the size of the
actor will always exactly match the total space taken up by the actors it contains. As a
result, the actor's boundsRect will automatically be constrained to change whenever the
boundsRect of any of its contents changes.

Default: False .

Getter
get the boundedByContents of me

me (an Actor)

Setter
set the boundedbycontents of me
to NewValue

me (an Actor)
to (a boolean): Whether to make this actor be bounded by contents.

See Also

bindByContents .

boundsrect of Actor
The boundsRect property determines the location of an actor's four corners, and therefore
determines the size and location of the actor.

Getter
get the boundsRect of me
with physical

Returns a list of four integers: the left, top, right and bottom points enclosing the actor's
frame area. The points lie within the frame area.

Note: While an actor such as an Oval has no corners, it still has a boundsRect property.
In the case of Oval actors, the boundsRect property determines the largest oval in size
and shape that can fit within its coordinates.◆

Page 10
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b o u n d s r e g i o n o f A c t o r

me (an Actor)
[with physical] (a boolean): If True , the values are in physical rather than
logical coordinates. The default is False .

Setter
set the boundsrect of me
with physical
with relative
with justmoving
to NewValue

Sets the Actor's boundsRect to the rect specified. Calls setBoundsRect to set the
boundsRect .

me (an Actor)
[with physical]
[with relative]
[with justmoving]
to

Example
get the boundsRect of the Actor with physical boolean

See Also

setBoundsRect for a detailed description of all the options, left , top , right , bottom ,
h , v, and location .

boundsregion of Actor
This property holds the mask that defines the bounds of the actor. This mask is computed
automatically by the system from the actor's boundsRect using the
makeBoundsRegion handler.

Note: If the bounds region is not up to date, the getter for this property forces it to be
recomputed by calling makeBoundsRegion . Thus it is a really bad idea to call
boundsRegion from within the body of your own makeBoundsRegion . Use getValue
instead.◆

Getter
get the boundsRegion of me

Page 11
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c a c h e s p i x m a p o f A c t o r

me (an Actor)

Setter
set the boundsregion of me
to NewValue

Sets the actors bounds mask to the mask specified.

Note: Setting this property is a bad idea since the system will automatically change the
mask any time the actor changes boundsRect or container.◆

me (an Actor)
to (a Mask): The mask to install in this property.

See Also

makeBoundsRegion .

cachespixmap of Actor

Getter
get the cachesPixmap of me

If cachesPixMap is True , then the actor's drawing information will be cached by the
system. When an actor's drawing information is cached, the actor is drawn or re-drawn
almost instantly. The trade-off is that caching an actor's drawing information uses
memory, so if non-cached drawing speeds are acceptable for your project you might
choose not to cache an object's drawing information.

This property defaults to False .

Note: caching will not be effective when the contents of the actor to be cached moves a
lot.◆

me (an Actor)

Setter
set the cachespixmap of me
to NewValue

Page 12
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o l o r d e p t h o f A c t o r

me (an Actor)
to (a boolean)

See Also

capturePicture of ImageRenderer for an alternative to using this handler.

colordepth of Actor
This property specifies the depth (i.e., the number of bits per pixel) the actor wants to use
when drawing itself on the Stage. Thus, the colordepth directly affects the number of
colors the actor will be able to display when it becomes a window.
The depth can be set as follows:
0 (as many colors as the main monitor can support)
1 (black and white only)
2 (4 colors)
4 (16 colors)
8 (256 colors)
32 (millions of colors), and
False (as many colors as the main monitor can support but drawing directly to the
screen).
Setting the colordepth property to False forces the SK8 graphics engine to draw the
actor's components directly on the screen. This saves memory, but it may cause drawing
to appear jerky when dragging other windows over the actor.
Defaults to 0.
Note: every actor in a window is drawn using the same colorDepth : the colorDepth
of the window itself (the actor whose container is the Stage ). Thus changing the color
depth of an Actor that is inside a window has no effect neither on itself nor on its
window.◆

Getter
get the colorDepth of me

me (an Actor)

Setter
set the colordepth of me
to NewValue

Page 13
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o n t a i n e r o f A c t o r

me (an Actor)
depth

See Also

cachesPixmap , and colordepth for Monitor.

container of Actor

Getter
get the container of me

Returns the Actor's container. Can be False , the Stage or another actor.

me (an Actor)

Setter
set the container of me
with following
to NewValue

An actor may be contained by another actor, the Stage , or by nothing at all. Setting the
container to False removes the actor from its current container, if any. Setting the
container to the Stage makes the actor become a window.

The Actor's container is only changed if both the Actor and its potential new container
consent to the containment change. This handler, thus, does the following:

If there is a new container, calls newContentOk to find out if it accepts the new content.
Then the Actor's newContainerOk is called to see if the new container is acceptable. If
both these handlers returned True , the operation proceeds and the Actor changes
container.

Note: An actor may not contain itself.


Setting an actor's container to the Stage ensures that the actor and all of the actors that it
contains will be graphically visible. To contain an actor in the Stage means that the actor
will be drawn over the Stage . Thus, actors directly attached to the Stage behave like
windows. It is possible to attach any actor to the Stage : you may thus easily create, e.g.,
oval windows when the need arises.◆

Page 14
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o n t e n t s o f A c t o r

me (an Actor)
[with following]: False or another Actor. If the this argument is supplied,
the actor is placed "under" the actor specified in this argument (the
Actor will be placed in the immediate next layer ).
to: False , the Stage or an Actor.

Example
set myRect's container to the Stage
set myRect's container to false

See Also

contents , newContainerOK , newContentOK , layer.

contents of Actor

Getter
get the contents of me

Returns the contents of the actor as a list of actors in front to back order. If the actor
does not contain anything, then False is returned.

me (an Actor)

Setter
set the contents of me
to NewValue

You cannot set the contents property of actors. To add something to an actor's
contents you have to use the set container handler.

See Also

set container.

dofirstclick of Actor
This property specifies whether the actor wants to get a mouseDown event when it is not
the selected window and the user clicks on it. If set to False , when the actor is a window
and it is clicked on, it gets an activate event. If set to True , in addition to the
activate event, a mousedown event is sent.

Page 15
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d o u b l e c l i c k s t y l e o f A c t o r

Defaults to False .

Getter
get the doFirstClick of me

me (an Actor)

Setter
set the dofirstclick of me
to NewValue

me (an Actor)
to (a boolean)

doubleclickstyle of Actor
The doubleClickStyle property specifies the manner in which an actor combines
mouseDown events into clicks /doubleClicks .

Getter
get the doubleClickStyle of me

Returns the manner in which an actor combines mouseDown events into clicks/
doubleClicks. The options are:

'standard' : clicks and doubleclicks are generated when appropriate.

'clickOnly' : no doubleClicks are generated.

'doubleClickOnly' : no clicks are generated.

Defaults to 'standard' .

me (an Actor)

Setter
set the doubleclickstyle of me
to NewValue

me (an Actor)
to: One of 'standard' , 'clickOnly' or 'doubleClickOnly' .

Page 16
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d r a g g a b l e o f A c t o r

draggable of Actor
When the draggable property of an actor is set to False , the actor may not be dragged.
Setting the draggable property of an actor to True restores its ability to be dragged by the
mouse.
Note: This property only prevents the drag handler from dragging the actor (drag does
nothing if the Actor's draggable is False ). It will have no effect on any other handlers
that you could use to do the dragging by hand.◆

Getter
get the draggable of me

me (an Actor)

Setter
set the draggable of me
to NewValue

me (an Actor)
to (a boolean)

Example
To explain the note above, we could try to implement the drag handler ourselves. We
could write a simple version of it as shown below. Since this handler does not check the
draggable property, the property will have no effect on whether you can drag the actor
or not. The draggable property only works if you use the built-in drag handler.
on drag of me (an Actor)
repeat while the mouse is down
set {h,v} to the mouseloc of the Stage
-- since the mouseloc of the Stage is always returned
-- in physical coords, set the physical location!
set my location with physical to {h,v}
end repeat
end drag

fillColor of Actor
This property specifies the Renderer that is used to render (draw) the actor's
fillRegion .

Defaults to White .

Page 17
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
fi l l r e g i o n o f A c t o r

Getter
get the fillColor of me

me (an Actor)

Setter
set the fillcolor of me
to NewValue

me (an Actor)
to (a Renderer)

See Also

setFillColorActor of Renderer, setFillColorActor of DynamicRenderer

fillregion of Actor
This property holds the mask that defines the fill area of the actor. This mask is computed
automatically by the system from the actor's boundsRect using the makeFillRegion
handler.
Note: If the fill region is not up to date, the getter for this property forces it to be
recomputed by calling makeFillRegion . Thus it is a really bad idea to call fillRegion
from within the body of your own makeFillRegion . Use getValue instead.◆

Getter
get the fillRegion of me

me (an Actor)

Setter
set the fillregion of me
to NewValue

Sets the actors fill mask to the mask specified.

Note: Setting this property is a bad idea since the system will automatically change the
mask any time the actor changes boundsRect or container.◆

me (an Actor)
to (a Mask): The mask to install in this property.

Page 18
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
fl o a t i n g o f A c t o r

See Also

makeFillRegion .

floating of Actor
This property specifies whether an actor becomes a "windoid" when it is attached to the
Stage . When floating is True , the actor floats above all windows that are not floating.

Note: Use the layer property to change the layer of a windoid with respect to other
windoids.◆

Getter
get the floating of me

me (an Actor)

Setter
set the floating of me
to NewValue

me (an Actor)
to (a boolean)

framecolor of Actor
Returns the Renderer used to render the Actor's frame. In SK8, a frame is the mask that
defines the Actor's perimeter.
Defaults to Black .

Getter
get the frameColor of me

me (an Actor)

Setter
set the framecolor of me
to NewValue

Note: If you don't want the frame to be drawn, SK8 performs faster with the frameSize
set to {0,0} than it does with the frameColor set to Transparent .◆

Page 19
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
f r a m e h e i g h t o f A c t o r

me (an Actor)
to (a Renderer)

See Also

setFrameColorActor of Renderer, setFrameColorActor of


DynamicRenderer

frameheight of Actor
Specifies the size of the actor's frameRegion along the vertical axis. (The frame is the
region that defines the perimeter of an actor. )

Getter
get the frameheight of me

me (an Actor)

Setter
set the frameheight of me
to NewValue

Calls setFrameSize to set the size.

me (an Actor)
to (a Number)

See Also

setFrameSize , frameSize , frameWidth .

frameregion of Actor
This property holds the mask that defines the frame of the actor. This mask is computed
automatically by the system from the actor's boundsRect using the makeFrameRegion
handler.
Note: If the frame region is not up to date, the getter for this property forces it to be
recomputed by calling makeFrameRegion . Thus it is a really bad idea to call
frameRegion from within the body of your own makeFrameRegion . Use getValue
instead.◆

Page 20
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
f r a m e s i z e o f A c t o r

Getter
get the frameRegion of me

me (an Actor)

Setter
set the frameregion of me
to NewValue

Sets the actors bounds mask to the mask specified.

Note: Setting this property is a bad idea since the system will automatically change the
mask any time the actor changes boundsRect or container.◆

me (an Actor)
to (a Mask): The mask to install in this property.

See Also

makeFrameRegion .

framesize of Actor
This property specifies the size of a frame's region as a list of two numbers: the first
number is for the frame's size along the horizontal axis (its width) and the second number
is for the size along the vertical axis (its height).

Getter
get the frameSize of me
with physical

me (an Actor)
[with physical] (a boolean): If True , the size in pixels is returned.

Setter
set the framesize of me
with physical
to NewValue

Note: This handler calls setFramesize to actually do the work. Thus, you should
redefine setFramesize if you need extra behavior.◆

Page 21
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
f r a m e w i d t h o f A c t o r

me (an Actor)
[with physical] (a boolean): If True , the size is assumed to be given in pixels.
to: A list of 2 numbers.

Example
get the frameSize of MyRect with physical
set the frameSize of MyRect to {4, 3}

See Also

frameWidth and frameHeight .

framewidth of Actor
Specifies the size of the Actor's frameRegion along the horizontal axis. (The frame is the
region that defines the perimeter of an actor. )

Getter
get the framewidth of me

me (an Actor)

Setter
set the framewidth of me
to NewValue

Calls setFrameSize to do the work.

me (an Actor)
to (a Number)

See Also

setFrameSize , frameHeight , frameSize .

h of Actor
Specifies the horizontal position of the center of the actor's boundsRect . This is a virtual
property computed from the boundsRect property.

Page 22
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h e i g h t o f A c t o r

Getter
get the h of me
with physical

me (an Actor)
[with physical] (a boolean): If True , the position is returned in physical
(Stage ) coordinates.

Setter
set the h of me
with physical
with relative
to NewValue

me (an Actor)
[with physical] (a boolean): If True , the number is assumed to be given in
Stage coordinates.
[with relative] (a boolean): If True , the current horizontal location is
offsetted bv the number provided.
to (a Number)

See Also

setLocation for an important note on redefining this handler.

height of Actor
Specifies the vertical size of the actor's boundsRect . This is a virtual property computed
from the boundsRect property.

Getter
get the height of me
with physical

me (an Actor)
[with physical]: If True , the size is returned in pixels.

Setter
set the height of me
with physical
to NewValue

SetSize is called to do the work.

Page 23
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h i g h l i g h t o f A c t o r

me (an Actor)
[with physical] (a boolean)
to (a Number)

See Also

setSize and setBoundsRect , size .

highlight of Actor
This property specifies whether the Actor is currently highLighted. Graphically, being
highlighted can mean any arbitrary change. The default behavior (which happens when
the Actor's inverts property is True ) is to render the actor with complementary colors.
If the inverts property is set to False , custom highlighting can be done.

Getter
get the highlight of me

me (an Actor)

Setter
set the highlight of me
to NewValue

Sets the property and forces a graphical update to show the Actor in its highlighted (or
unhighlighted) state.

me (an Actor)
[to]

Example
To do custom highlighting, you need to redefine the set highlight handler and make
sure the inverts property is set to False . Here is an example of the code actually used
by the buttons in the file dialog:

Page 24
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h o r i g i n o f A c t o r

on set highlight of me (a dialogBoxButton) to newValue


-- it's important to call the next handler!
do inherited
-- do the hiliting by hand by setting the fillcolor!
if newValue then
set my fillcolor to InversebuttonGradientColor
else
set my fillcolor to buttonGradientColor
end if
end set hilite

See Also

inverts .

horigin of Actor
Specifies the horizontal component of the actor's origin . This is a virtual property
computed from the origin property.

Getter
get the horigin of me

me (an Actor)

Setter
set the horigin of me
to NewValue

me (an Actor)
to (a Number)

See Also

setOrigin , origin .

hscale of Actor
Specifies the horizontal component of the actor's scale . This is a virtual property
computed from the scale property.

Getter
get the hscale of me

Page 25
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n v e r t s o f A c t o r

me (an Actor)

Setter
set the hscale of me
to NewValue

Calls setScale to do the work.

me (an Actor)
to: A positive number.

See Also

setScale , scale .

inverts of Actor
Determines how the actor highlights itself. If inverts is True and you highlight an actor,
the graphics system will invert the color of the actor. If inverts is False , the system
performs no graphical change, giving you the freedom to do custom highlighting.
Defaults to True .

Getter
get the inverts of me

me (an Actor)

Setter
set the inverts of me
to NewValue

me (an Actor)
to (a boolean)

See Also

highlight for an example of how to do custom highlighting.

Page 26
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
k e y t a r g e t o f A c t o r

keytarget of Actor
Specifies which actor in this actor's contents gets key events when the actor becomes a
window (its container becomes the Stage ).

Getter
get the keytarget of me

me (an Actor)

Setter
set the keytarget of me
to NewValue

Makes the actor in the to argument be the recipient of the actor's key events. Setting the
keyTarget of an actor not contained by the Stage has no effect. When the actor is a
window, the new keytarget actor (which should be in its contents) gets an activateText
message.

A window may have either zero or one keyTarget actor. Typically, this will be an editable
text field.

When the autotab property of the keyTarget of the window is True , tabbing may cause
the keyTarget to change (See the autotab property for details).

me (an Actor)
to (an Actor): The new actor to become keyTarget or False if you want to
stop this window from dispatching key events to anyone.

Example
Very often, we want a specific actor to be the keyTarget of its window when the
window activates. An example of this is a dialog where we want the specific editText to be
ready to accept the user's input. We can redefine the activate event of the dialog for this
purpose. Consider a dialog called WeightDialog and an editText provided for entering
the weight called WeightField .
on activate of me (a WeightDialog)
-- It is important to call the next handler!
do inherited
set my keyTarget to the WeightField
end activate

See Also

activateText , autoTab , keyDown , keyUp , autoKey, and tabToNextActor.

Page 27
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l a y e r o f A c t o r

layer of Actor
Specifies the actor's position in the front-to-back order of its container's contents. The
layer is a positive integer in the range of 1 to the number of actors in its container's
contents. Lower-numbered actors cover higher-numbered actors.
Note: Every SK8 actor is assigned a layer. If an actor contains eight actors, each
contained actor is numbered from 1 to 8. Objects receive their number in the order they
appear in the contents of their container, i.e., from front to back, starting from 1. When
dealing with graphics, the layer property determines the precedence by which actors
cover or are covered by other actors. Lower-numbered actors cover higher-numbered
actors.
Warning:
Exercise care when referencing an actor by its layer property when writing scripts, since
an actor's layer is never permanently assigned (use the actor's objectName instead).
Layer properties exist only to show an actor's place among other actors of its kind.

If, for example, an actor contains eight actors, deleting the first contained actor will cause
each of the remaining actors to have the value of their layer property reduced by one
(valid actor numbers would now be from 1 to 7). Similarly, setting the layer of the
highest numbered actor to 1 automatically raises the layer of all other actors sharing the
container by 1.◆

Getter
get the layer of me

me (an Actor)

Setter
set the layer of me
to NewValue

me (an Actor)
to: A positive integer.

See Also

bringToFront , sendToBack , bringCloser and sendFarther.

left of Actor
The left of the actor's boundsRect . This is a virtual property computed from the
boundsRect .

Page 28
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l o c a t i o n o f A c t o r

Getter
get the left of me
with physical

me (an Actor)
[with physical] (a boolean): If True , the left point is returned in physical
coordinates.

Setter
set the left of me
with physical
with relative
with resizing
to NewValue

me (an Actor)
[with physical] (a boolean): If True , assumes that the left is specified in
physical coordinates.
[with relative] (a boolean): If True , the current left of the actor is changed
by the amount specified.
[with resizing] (a boolean): If True (the default), setting the left of the
actor constrains all other boundsRect positions to remain as they are.
The actor will thus be resized. If False , the actor will move to make its
boundsRect coincide with the new left position.
to (a Number)

See Also

setLocation and setBoundsRect , boundsRect , top , right , bottom , h , v, and


location .

location of Actor
An actor's location is the center of its boundsRect .
Note: this is a virtual property computed from the actor's boundsRect . If you want to be
absolutely sure to catch all changes in location of your actor you should redefine
setBoundsRect since all geometrical changes go through that handler.◆

Getter
get the location of me
with physical

Page 29
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l o c a t i o n o f A c t o r

me (an Actor)
[with physical] (a boolean): If True , the actor's location is returned in
physical (Stage ) coordinates.

Setter
set the location of me
with relative
with physical
to NewValue

Changes the Actor's boundsRect so that its center is the point {h,v} . Calls
setLocation to do the work.

me (an Actor)
[with relative] (a boolean): If True , the current location is offseted by the
numbers specified in the to argument.
[with physical] (a boolean): If True , it is assumed that the numbers
provided are in physical coordinates.
to: A list of two numbers.

Example
Let us write the simplest layout algorithm there is.
We have a rectangle, called GridRect , whose size is 100 by 100. The task is to arrange 100
rectangles into it, side by side. We need two loops: one for the rows and one for the
columns. Note that the location of the first rectangle should be {5,5} and the
location of the last should be {95,95} . Here is the arrange handler:
on arrange of me (a GridRect)
repeat with rowNumber from 0 to 9
repeat with colNumber from 0 to 9
set r to new rectangle with size {10,10}
set r's container to me
set r's location to {5+10*rowNumber, 5+10*colNumber}
end repeat
end repeat
end arrange

See Also

setLocation , boundsRect and setBoundsRect .

Page 30
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o u s e s e n s i t i v i t y o f A c t o r

mousesensitivity of Actor
The mouseSensitivity property determines whether a container or its contents receives
mouse-related events. Mouse-related events are generated through the mouse, and
include events such as mouseEnter, mouseLeave , mouseUp , and click .
The mouseSensitivity can be one of 'normal' , 'opaque' , 'transparent' ,
'invisible' or 'custom' .

Under normal circumstances (when mouseSensitivity is set at its default normal


value), mouse-related events that occur over an actor's contents are sent to the actor's
contents. If, however, the event happens over the container actor and not over any of the
contained actors, the event is sent to the container actor.
When an actor's mouseSensitivity is set to opaque , all mouse-related events that
happen within it or its contents are sent to itself: the contents become isolated from mouse
events.
When an actor's mouseSensitivity is set to transparent , all mouse-related events
are sent to the actor's contents, and never to the container actor; if a mouse-related event
happens within the actor, but does not occur within any of the contained actors, no event
is accepted. The transparent setting keeps the container actor from ever receiving
mouse-related events.
When an actor's mouseSensitivity is set to invisible , the actor becomes invisible to
mouse events, and all its contents become invisible with it. The actor and its contents are
not 'seen' by the event system.
Finally, when an actor's mouseSensitivity is set to custom , the actor can do its own
tests to determine whether it has been hit by the mouse. Each time the system wants to
determine whether such an actor has been hit, the handler hitByMouse is called. The
actor then performs its arbitrary test, returning True or False as appropriate.

Getter
get the mouseSensitivity of me

me (an Actor)

Setter
set the mousesensitivity of me
to NewValue

me (an Actor)
to: One of 'normal' , 'opaque' , 'transparent' , 'invisible' or
'custom' .

See Also

hitByMouse .

Page 31
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o r i g i n o f A c t o r

origin of Actor
Specifies the point in the cordinate system defined by the actor that coincides with the top
left of the Actor's boundsRect .
Defaults to {0,0} .

Getter
get the origin of me

me (an Actor)

Setter
set the origin of me
with forceredraw
to NewValue

Moves the point in the local coordinate system of the Actor specified by {h,v} to the
topLeft of the Actor's boundsRect. As a result, the entire contents of the actor pans to
accommodate the new origin.

Calls setOrigin to do the work.

Note: If the forceRedraw argument is False the system optimizes the operation
making it considerably faster. There are a number of circumstances, however, in which
this optimization results in draw errors.
In particular, the actor to be panned should not be covered in any part by any actors in its
window. Also the actor (or anything in it) may not be rendered with renderers that do not
render masks uniformly (like an imageRenderer that paints a PICT as opposed to
something like Red ).
In general, a redraw error when panning is a clear indication that you cannot use this
optimization and thus should call this handler with the forceRedraw argument set to
true .◆

me (an Actor)
[with forceredraw] (a boolean): If True (the default) , everything in the
Actor is redrawn.
to: A list of two numbers.

See Also

setOrigin , hOrigin , and vOrigin .

Page 32
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e s i z a b l e o f A c t o r

resizable of Actor
Specifies whether an actor can be resized by the resize handler.
Defaults to True .
Note: The resize handler looks at the resizable property before actually resizing an
actor, but you can still set the boundsRect . This property, thus, acts like the draggable
property.◆

Getter
get the resizable of me

me (an Actor)

Setter
set the resizable of me
to NewValue

me (an Actor)
to (a boolean)

See Also

draggable .

resizescontents of Actor
Determines whether the actor will resize its contents when it changes boundsRect .
If the resizesContents property of an actor is set to True , whenever the boundsRect
of the actor grows or shrinks, the boundsRect of all of its contained actors proportionally
adjust in size and location.
Defaults to False .
Note: Setting this property of actor X to True makes X resize its subactors when it itself is
resized. There is a caveat, however: in order for this to work SK8 caches the rects of its
contents when the property is set. The cache will move out of synch when any of the
subactors are moved or resized! Therefore, it's important that you recache the rects –– in
this case, by calling the cacheContentsRects handler on X.◆

Getter
get the resizesContents of me

me (an Actor)

Page 33
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r i g h t o f A c t o r

Setter
set the resizescontents of me
to NewValue

me (an Actor)
to (a boolean)

See Also

cacheContentsRects and scaleContents .

right of Actor
The right of the actor's boundsRect . This is a virtual property computed from the
boundsRect .

Getter
get the right of me
with physical

me (an Actor)
[with physical] (a boolean): If True , the right point is returned in physical
coordinates.

Setter
set the right of me
with physical
with relative
with resizing
to NewValue

me (an Actor)
[with physical] (a boolean): If True , assumes that the right is specified in
physical coordinates.
[with relative] (a boolean): If True , the current right of the Actor is
changed by the amount specified.
[with resizing] (a boolean): If True (the default), setting the right of the
actor constrains all other boundsRect positions to remain as they are.
The actor will thus be resized. If False , the actor will move to make its
boundsRect coincide with the new right position.
to (a Number)

Page 34
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s c a l e o f A c t o r

Example
We can use this property to write a progressBar actor. The ProgressBar would be a
rectangle with a rectangle inside it. Let's make the main object:
new rectangle with objectName "ProgressBar" with size {100,20}
addProperty ProgressBar, 'percentageCompleted'
We added a property to keep track of how much of the task we keep track of has been
completed. Next, we make the Black rectangle that shows the progress.
new rectangle with objectName "ProgressBarBar"
set the container of ProgressBarBar to ProgressBar
set the boundsRect of ProgressBarBar to {0,0,2,20}
So, in the initial state, our ProgressBar is a white rectangle with a little black rectangle
in the left side. We complete the work by writing the set percentageCompleted
handler to update the black bar. We assume the percentage is a number between 0 and 100.
on set percentageCompleted of me (a ProgressBar), percent
-- call the next handler to set the property!
do inherited
-- now set the right of the progressBarBar to the percent.
set the right of item 1 in my contents to percent
end set percentage
We can now test our object by putting it on the Stage and typing into the messagebox
something like:
repeat with i from 1 to 100
set the percentageCompleted of the ProgressBar to i
end repeat

See Also

setLocation and setBoundsRect , boundsRect , left , bottom , right , h , v, and


location .

scale of Actor
Specifies the actor's scale. The default scale is {1,1} . A scale of 1 means that if the logical
width of an actor in the Actor's contents equals 100, that actor is 100 pixels wide. Setting
the scale to 2 doubles the number of pixels required per logical unit (the actor would be
200 pixels wide).

Getter
get the scale of me

me (an Actor)

Page 35
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s i z e o f A c t o r

Setter
set the scale of me
to NewValue

Sets the Actor's scale to {h,v} . SetScale is called to do the work.

me (an Actor)
to: A list of 2 positive numbers.

Example
Consider a rectangle called ZoomRect containing a square in its top left corner. The
scale of ZoomRect is {1,1} .
new rectangle with objectName "ZoomRect" with container Stage
with boundsRect {100,100,300,300}
new rectangle with objectName "InnerSquare"
with container ZoomRect with boundsRect {2,2,22,22}
The following command will double the square's size:
set ZoomRect's scale to {2,2}
One thing to note is that the square's top left corner, which used to be 2 pixels away from
ZoomRect 's topLeft corner, is now 4 pixels away. In fact, every actor inside ZoomRect
would double the physical distance between its topLeft and ZoomRect 's topLeft.
set ZoomRect's scale to {0.5,2}
This command will flatten InnerSquare into a vertical rectangle. InnerRect appears to
have been stretched vertically while it was shrunk horizontally.
Note that if we got the boundsRect of InnerRect (the logical boundsRect ), we would
still get the original boundsRect : {2,2,22,22} .

See Also

setScale ,, rescaled zoom , hscale , and vscale .

size of Actor
Specifies the width and height of the actor's boundsRect .
Note: this is a virtual property derived from the actor's boundsRect .◆

Getter
get the size of me
with physical

Page 36
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
Te x t o f A c t o r

me (an Actor)
[with physical] (a boolean): If True , the size in pixels is returned.

Setter
set the size of me
with relative
with physical
to NewValue

Sets the Actor's width and height to h and v respectively. SetSize is called to do the
work. If the size specified is smaller than the minimumSize , the size is set to the
minimumSize .

me (an Actor)
[with relative] (a boolean): If True , the widht and height provided are
added to the current width and height to compute the new size.
[with physical] (a boolean): If True , the width and height are assumed to be
given in Stage coordinates.
to (a list of 2 numbers): The new width and height respectively.

Example
get the size of Actor with physical

See Also

setSize and setBoundsRect , and boundsRect .

Text of Actor
Specifies the actor's text string. If there is no text string, the text property returns "".
The text draws itself at the center of the actor. The textLocation , textVOffset and
textHOffset properties let you change the position. You can also change the text's font,
size and color using the textFont , textSize and textColor properties.
Actors can only display one line of text. You cannot refer to ranges in non-EditText actors;
and therefore, you cannot have mixed fonts.

Getter
get the Text of me
with start
with end

Page 37
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t e x t c o l o r o f A c t o r

me (an Actor)
[with start]: Ignored (only used in special actors).
[with end]: Ignored (only used in special actors).

Setter
set the text of me
with textlocation
to NewValue

Sets the text of the Actor to text. If the textLocation argument is provided, this handler
also sets the textLocation of the Actor.

me (an Actor)
[with textlocation]: A textLocation option. One of 'topLeft' ,
'topRight' , 'topCenter' , 'centerLeft' , 'centerRight' ,
'center' , 'bottomLeft' , 'bottomRight' , 'bottomCenter' .
to: Anything (if not a string its objectString is used).

See Also

textLocation , textSize , textFont , textStyle , textColor, textHOffset , and


textVOffset .

textcolor of Actor
Specifies the renderer the Actor is using to render its text. Defaults to Black .
Note: The system optimizes the case when the Renderer is a child of RGBColor. While
any Renderer can be used, performance is greatly improved in the former case.◆

Getter
get the textColor of me
with start
with end

me (an Actor)
[with start]: Ignored (only used in special Actors).
[with end]: Ignored (only used in special Actors).

Page 38
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t e x t F o n t o f A c t o r

Setter
set the textcolor of me
with start
with end
to NewValue

me (an Actor)
[with start]: Ignored (only used in special Actors).
[with end]: Ignored (only used in special Actors).
[to]

Example
How about an actor that tries very hard to hide its text by making its textColor the
same as its fillColor ?
If we wanted such a strange contraption, this is what we would do. Firt we create the
object and make its textColor and fillColor be the same.
new rectangle with objectName "lookMaNoText"
set lookMaNoText's textcolor to lookMaNoText's fillColor
Now we redefine its set fillcolor handler to keep them in synch.
on set fillcolor of me (a LookMaNoText) to newValue
-- call the next handler to set the color.
do inherited
-- and set the textcolor to it.
set my textcolor to newValue
end set fillcolor

See Also

setTextColorActor of Renderer, setTextColorActor of DynamicRenderer

textFont of Actor
This property stores the Font in which an actor's text appears. Defaults to Chicago .
Note: You can call the fonts handler of the System object to see what fonts are available in
your current environment.◆

Getter
get the textFont of me
with start
with end

Page 39
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t e x t h o f f s e t o f A c t o r

me (an Actor)
[with start]: Ignored (only used in special Actors).
[with end]: Ignored (only used in special Actors).

Setter
set the textfont of me
with start
with end
to NewValue

me (an Actor)
[with start]: Ignored (only used in special Actors).
[with end]: Ignored (only used in special Actors).
to: Either a Font or a font name as a string (eg. "Chicago").

See Also

the fonts of the System .

texthoffset of Actor
Specifies the horizontal offset of an actor's text from the location specified by the
textLocation property.

The textHOffset positions an actor's text to the right of the location specified by the
textLocation property by the number of pixels specified in the textHOffset property's
argument. If the number specified in the textHOffset argument is negative, the text is
offset to the left.
Defaults to 0.
Note: this property does not affect the text in EditText actors.◆

Getter
get the texthoffset of me

me (an Actor)

Setter
set the texthoffset of me
to NewValue

me (an Actor)
to (an Integer)

Page 40
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t e x t l o c a t i o n o f A c t o r

See Also

textOffset , textLocation .

textlocation of Actor
The textLocation property specifies the position of an actor's text as one of nine points
within the actor.
The first word of the setting (top, center, or bottom) controls the text's vertical positioning
within the actor (with the notable exception of the use of center instead of centerCenter).
The second word of the setting (left, center, or right) controls the text's horizontal
positioning within the actor.
For example: text given a horizontal value of left will be left-aligned; text given a
horizontal value of center will be center-aligned; and text given a horizontal value of right
will be right-aligned.
The textLocation can be adjusted further by use of the textHOffset and textVOffset
properties.
Defaults to 'center' .
Note: the textLocation does not affect the justification of text in EditText actors. Use
the justification property for that.◆

Getter
get the textLocation of me

me (an Actor)

Setter
set the textlocation of me
to NewValue

me (an Actor)
to: One of 'topLeft' , 'topRight' , 'topCenter' , 'centerLeft' ,
'centerRight' , 'center' , 'bottomLeft' , 'bottomRight' ,
'bottomCenter' .

Example
The Label is a rectangle that resizes itself in order to always show all its text . When the
Label changes size, it does so in accordance with the textLocation property: if the
textLocation is 'topleft' , 'centerLeft' or 'bottomLeft' the text is left
justified, meaning that the left margin should stay constant. This means that in this case

Page 41
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t e x t o f f s e t o f A c t o r

the label will resize keeping its left in the same place. If the text is right justified, the right
is kept constant, and if it is centered, the center is kept constant.
We define a handler called bindLabelText which we will call each time the Label 's text
size can change. For simplicity, assume that all we care about is the horizontal size of the
actor (we will not change the vertical size).
on bindLabelText of me (a Label)
set {h,v} to my actorTextSize
set tl to my textLocation
if tl='center' or tl='topCenter' or tl='bottomCenter' then
-- simplest case: setting the width preserves the center.
set my width to h
else
if tl='topLeft' or tl='centerLeft' or tl='bottomLeft' then
-- preserve the left!
set my right to my left + h
else
-- preserve the right!
set my left to my right - h
end if
end if
end bindLabelText

See Also

textHOffset and textVOffset .

textoffset of Actor
Specifies the number of pixels of offset from the Actor's textLocation to the point
where the text is actually drawn. This property, in conjunction with the textLocation
property, can be used to let you move the actor's text to any position within the actor.
Note: this property does not affect the text in EditText actors.◆

Getter
get the textOffset of me

Calls textHOffset and textVOffset to get the values.

me (an Actor)

Setter
set the textoffset of me
to NewValue

Calls set textHOffset and set textVOffset to do the work.

Page 42
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t e x t s i z e o f A c t o r

me (an Actor)
to: A list of 2 integers.

See Also

textHOffset , textVOffset , and textLocation .

textsize of Actor
Specifies the font size in points that the Actor uses to render its text . (A point is a unit of
measurement that is equal to approximately 1/72 of an inch.) To ensure legibility on the
screen, the textSize is usually set to 9 or higher.

Getter
get the textSize of me
with start
with end

me (an Actor)
[with start]: Ignored (only used in special Actors).
[with end]: Ignored (only used in special Actors).

Setter
set the textsize of me
with start
with end
to NewValue

me (an Actor)
[with start]: Ignored (only used in special Actors).
[with end]: Ignored (only used in special Actors).
to (an Integer)

textstyle of Actor
Specifies the style in which the actor's text gets displayed. The textStyle is a list of all
the styles currently being applied to the actor's text.
The styles that SK8 supports on a standard Macintosh system are plain, bold, italic,
underline, outline, shadow, condense and expand.
Default: {'plain'} .

Page 43
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t e x t v o f f s e t o f A c t o r

Getter
get the textStyle of me
with num
with start
with end

me (an Actor)
[with num]: Ignored (only used in special Actors).
[with start]: Ignored (only used in special Actors).
[with end]: Ignored (only used in special Actors).

Setter
set the textstyle of me
with start
with end
to NewValue

me (an Actor)
[with start]: Ignored (only used in special Actors).
[with end]: Ignored (only used in special Actors).
to: A list of the following styles: 'plain' , 'bold' , 'italic' ,
'underline' , 'shadow' , 'outline' , 'condense' , 'expand' .

Example
set myRect's textStyle to {'bold', 'underline'}
set myRect's textStyle to {'plain'}

textvoffset of Actor
Specifies the vertical offset of an actor's text from the location specified by the
textLocation property.

The textVOffset positions an actor's text downward from the location specified by the
textLocation property by the number of pixels specified in the textVOffset property's
argument. If the number specified in the argument is negative, the text is offset upward by
the specified number of logical units.
Default: 0
Note: this property does not affect the text in EditText actors.◆

Getter
get the textvoffset of me

Page 44
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t o p o f A c t o r

me (an Actor)

Setter
set the textvoffset of me
to NewValue

me (an Actor)
to (an Integer)

top of Actor
The top of the actor's boundsRect . This is a virtual property computed from the
boundsRect .

Getter
get the top of me
with physical

me (an Actor)
[with physical] (a boolean): If True , the top point is returned in physical
coordinates.

Setter
set the top of me
with physical
with relative
with resizing
to NewValue

me (an Actor)
[with physical] (a boolean): If True , assumes that the top is specified in
physical coordinates.
[with relative] (a boolean): If True , the current top of the Actor is changed
by the amount specified.
[with resizing] (a boolean): If True (the default), setting the top of the actor
constrains all other boundsRect positions to remain as they are. The
actor will thus be resized. If False , the actor will move to make its
boundsRect coincide with the new top position.
to (a Number)

Page 45
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
v o f A c t o r

See Also

setLocation and setBoundsRect , boundsRect , left , bottom , right , h , v, and


location .

v of Actor
Specifies the vertical position of the center of the actor's boundsRect . This is a virtual
property computed from the boundsRect property.

Getter
get the v of me
with physical

me (an Actor)
[with physical] (a boolean): If True , the position is returned in physical
(Stage ) coordinates.

Setter
set the v of me
with physical
with relative
to NewValue

me (an Actor)
[with physical] (a boolean): If True , the number is assumed to be given in
Stage coordinates.
[with relative] (a boolean): If True , the current vertical location is offsetted
by the number provided.
to (a Number)

See Also

setLocation for an important note on redefining this handler.

visible of Actor
Determines whether an actor is shown in its container or hidden. When the value of the
visible property is set to False , the actor is invisible. Conversely, setting the visible
property of an actor to True will make the actor visible (assuming the actor is not covered
by other actors).
If an actor is not attached to a container, then it will not be shown, regardless of the setting
of its visible property.

Page 46
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
v o r i g i n o f A c t o r

Default: True
Note: Note that hiding an Actor makes it totally invisible to the event system (it will not
get mouse events).◆

Getter
get the visible of me

me (an Actor)

Setter
set the visible of me
to NewValue

me (an Actor)
to (a boolean)

See Also

show and hide .

vorigin of Actor
Specifies the vertical component of the actor's origin . This is a virtual property
computed from the origin property.

Getter
get the vorigin of me

me (an Actor)

Setter
set the vorigin of me
to NewValue

me (an Actor)
to (a Number)

See Also

setOrigin , origin .

Page 47
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
v s c a l e o f A c t o r

vscale of Actor
Specifies the vertical component of the actor's scale . This is a virtual property computed
from the scale property.

Getter
get the vscale of me

me (an Actor)

Setter
set the vscale of me
to NewValue

Calls setScale to do the work.

me (an Actor)
to: A positive number.

See Also

setScale , scale .

wantsidle of Actor
SK8 applications generate idle events when no handlers are running and no other events
are being generated. SK8 keeps a list of all actors and objects that have their wantsIdle
property set to True . When an idle event is sent, it is sent to each object on the list when
they are contained by the Stage .
Actors that have their wantsIdle property set to False are never sent idle events.
Default: False .
Note: Since time is taken to send each idle event, keep the wantsIdle property set to
False for all actors that don't make use of idle events. Otherwise, your project will be
unnecessarily slowed.◆

Getter
get the wantsIdle of me

me (an Actor)

Page 48
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w a n t s m o u s e w i t h i n o f A c t o r

Setter
set the wantsidle of me
to NewValue

me (an Actor)
to (a boolean)

See Also

idle .

wantsmousewithin of Actor
Determines whether the actor's mouseWithin handler is repeatedly called while the
mouse pointer is over the actor.
When the value of an actor's wantsMouseWithin property is set to False , the
mouseWithin handler does not get called when the pointer is over the actor.

Default: False .
Note: Note that repeatedly calling mouseWithin will slow the system down. Therefore,
only use this feature when it is really needed. For most cases, mouseEnter and
mouseLeave suffice.◆

Getter
get the wantsMouseWithin of me

me (an Actor)

Setter
set the wantsmousewithin of me
to NewValue

me (an Actor)
to (a boolean)

See Also

mouseEnter, mouseLeave , idle and mouseWithin .

width of Actor
Specifies the horizontal size of the actor's boundsRect . This is a virtual property
computed from the boundsRect property.

Page 49
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a c t i v a t e o f A c t o r

Getter
get the width of me
with physical

me (an Actor)
[with physical]: If True , the size is returned in pixels.

Setter
set the width of me
with physical
to NewValue

SetSize is called to do the work.

me (an Actor)
[with physical] (a boolean)
to (a Number)

See Also

setSize and setBoundsRect , size .

Handlers of Actor

activate of Actor
activate me
This handler is called when the Actor is a window and it is clicked on (the window is
selected). It is useful in allowing the alter the window's appeareance slightly to show its
new, active status.

me (an Actor)

Example
It could be a convention in your favorite window system to show that windows are active
by setting their framecolor to UiRectangleOutBevel , a BevelRenderer. All we need
for this is to redefine the activate handler to do it.
Let's do this for an imaginary rectangle called compliantWindow.

Page 50
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a c t i v a t e t e x t o f A c t o r

on activate of me (a compliantWindow)
-- important to do inherited to let the system
-- do its own activation work!
do inherited
-- now set the framecolor
set my framecolor to UiRectangleOutBevel
end activate

See Also

deactivate .

activatetext of Actor
activateText me
This handler is called when the actor becomes the keyTarget of its window, or when it is
the keyTarget and its window becomes the active window. The default handler does
nothing.

me (an Actor)

See Also

keyTarget .

actortextsize of Actor
actorTextSize me
with thetext
Returns the size of the text of an actor in pixels.

me (an Actor)
[with thetext] (a String): If theText is False (the default), the Actor's text is
used to compute the rect required. Otherwise the string provided in
theText is used. This is useful in determining how big the Actor
would be if its text was theText and all its text attributes remained the
same.

Example
If you want an actor to be like a Label in that its size is the size of its text you can say:
set my size to my actortextsize
Most of the work involved in writing the Label actor was making sure the line above was
included in the right places. The Label changes its size whenever its text changes size.

Page 51
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a d d c o n n e c t o r o f A c t o r

This will definitely happen when the text changes. Thus, we can achieve this
functionality by defining the set text handler as follows:
on set text of me (a Label) to newValue
-- important to do inherited to actually set the text!
do inherited
set {h,v} to my actorTextSize
set my size to {h,v}
end set text
The Label also does this when the textFont , textStyle or textSize change.

addconnector of Actor
addConnector me, theconnector
Adds theConnector to the actor's connectors. This handler is called by the connect handler
to let the actor remember who it is connected to.

me (an Actor)
theconnector (a Connector)

addedmeasparent of Actor
addedMeAsParent me, child, oldparents
Performs all the set up required to ensure than the actor (which might not have been an
actor before this handler got called).

me (an Actor)
child
oldparents

See Also

addParent , and changeParents .

autokey of Actor
autoKey me, thechar
The autoKey event is repeatedly sent by SK8 to the actor that is the keyTarget of the
active window while a user holds down a key on the keyboard long enough to send
repeat characters.
Sends a keyDown event to the actor.

Page 52
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b e s t s i z e o f A c t o r

me (an Actor)
thechar: The character that is being held down.

Example
Consider an actor, called TypingTutor, that tries to teach good typing techniques to the
user. One thing it might want to do is let the user know that she has left a key down for
too long, causing an autokey event. The handler could beep and then ignore the event as
follows:
on autokey of me (a TypingTutor), character
-- to ignore the key do not call the next handler.
beep
end autokey

See Also

keyDown .

bestsize of Actor
bestSize me
This handler is called to ask the actor to compute its best size. The default handler does
nothing.
Note: In general this handler is not automatically called by the system. This handler is
documented as an example of a nice, object oriented, way to implement layout
constraints. If you want it called for your objects you have to redefine resized as shown in
the example.◆

me (an Actor)

Example
In this example we show how bestSize can work together with resized to implement
automatic layout maintenance of actors. Consider a menubar called SnappingMenubar,
contained by a rectangle called ConsiderateContainer. The menubar always wants to
stay at the top of its container, adjusting its width to match its container's. We define its
bestsize and the resized of its container to call bestsize of everything in its
contents.

Page 53
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b i n d b y c o n t e n t s o f A c t o r

on bestSize of me (a SnappingMenubar)
set h to the width of my container
-- resize the menubar, preserving its height.
set my boundsRect to {0,0,h, my height}
end bestSize

on resized of me (a ConsiderateContainer)
repeat with subActor in my contents
bestSize subActor
end repeat
end resized
Then, whenever the ConsiderateContainer 's boundsRect changes (changing the
size), this handler will be invoked eventually calling the bestSize handler of the
SnappingMenubar.

See Also

resized .

bindbycontents of Actor
bindByContents me
Makes actor bind its contents. This involves two steps: computing the rectangle that
would bind all contents (even invisible ones), resetting the origin of the Actor so that the
contents stay in their place on the screen, and changing the boundsrect of theActor to
the new rectangle.
This handler is called when you set the boundedByContents of an Actor to True .
However, you can call it for any actor if you wish to achieve a temporary
boundedByContents effect.

me (an Actor)

See Also

boundedByContents .

bringcloser of Actor
bringCloser me
The bringCloser handler brings the actor closer to the top of its container's contents. This
is accomplished by lowering the actor's layer property by one (if the actor is not already
the topmost actor in its window).

me (an Actor)

Page 54
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b r i n g t o f r o n t o f A c t o r

Example
We define a new handler for Actors called "floatUpToSurface," which keeps increasing the
actor's layer until it is at the front of its container. Each time the actor comes closer, a
BubbleSound is played.
on floatUpToSurface of me (an Actor)
repeat until my layer = 1
bringCloser me
play BubbleSound
-- wait for half a second for effect.
wait 0.5 seconds
end repeat
end floatToSurface

See Also

bringToFront , sendFarther, sendToBack and set layer.

bringtofront of Actor
bringToFront me
The bringToFront handler brings the actor to the front of its container's contents. This is
equivalent to setting the Actor's layer to 1.

me (an Actor)

Example
Consider a RoundRect (a button), called PullerUp , whose sole purpose in life is to
bringToFront an actor when it is clicked on. PullerUp has a property called "subject,"
which stores the Actor that will be brought to the front. This property can be set directly
by the user or by dropping an actor onto PullerUp . For this, we need to define its
dropped handler as follows:
on dropped of me (a PullerUp), dropee
set my subject to dropee
end drop
Now we define the click handler to bring the subject up if there is one.
on click of me (a PullerUp)
-- make sure a subject is available.
if my subject then
bringToFront my subject
end if
end click

Page 55
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b r i n g u p o f A c t o r

See Also

bringCloser, sendFarther, sendToBack and set layer.

bringup of Actor
bringUp me
The bringUp handler makes sure the actor is on the Stage , that it is the frontmost
window and its visible property is set to True .

me (an Actor)

Example
Consider a UI that has a number of windows that the user can close at anytime. It might
be desirable to reset the UI to its original state by bringing up all the windows that are up
originally. This could be tied in to a menuItem called RestoreUIWindows , using a global
variable called uiWindows. We define the menuSelect handler as follows:
on menuSelect of me (a RestoreUIWindows)
global uiWindows
bringUp every item in uiWindows
end menuSelect

changeparents of Actor
changeParents me, newparents
This handler makes is makes sure that the actor redraws itself in order to show possible
changes in its geometry resulting from the change of its baseParent .

me (an Actor)
newparents

clearselection of Actor
clearSelection me
This handler is called to clear the Actor's selection. The system will automatically send
this message to the keyTarget of the active window when the user selects "Clear" from a
menu. The default handler does nothing, since the concept of "selection" only applies to
specific actors.

me (an Actor)

Page 56
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c l i c k o f A c t o r

See Also

keyTarget and clearSelection of EditText for an example of how to redefine this


handler.

click of Actor
click me
A click event is sent to an actor whenever the user clicks the mouse button on it. A
click event is defined as the user pressing and releasing a mouse button over an actor.
The time allowed between the press and the release of the mouse button varies by system
according to a setting made in the control panel.
The default handler sends the click to the Actor's container.
Note: The default mouseUp handler of Actor determines whether a click event should
be generated by taking into consideration the time elapsed between mouseDown and
mouseUp and the Actor's doubleClickStyle . If you are not getting clicks make sure the
default mouseUp of Actor is being called and the doubleClickStyle is set properly.◆

me (an Actor)

See Also

mouseUp , and doubleClickStyle .

close of Actor
close me
The close handler is called when the actor is a window and its window gets closed using
Command-W, or choosing Close from SK8's File menu.
The default handler sets the actor's container to False .

me (an Actor)

commandkeyevent of Actor
commandKeyEvent me, thechar
The commandkeyevent handler is called on the currentCommandKey of the System
when the user types Command-character. The default handler for Actor passes the
commandKey event on to the actor's container.

Page 57
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o n n e c t o f A c t o r

me (an Actor)
thechar (a Character)

Example
The following example shows how to make an arbitrary menubar on a window get
commandKey events. Consider a rectangle called MyControlPanel which contains a
menubar with menus and menuItems. Some of the menuItems have their commandKey
property set. When MyControlPanel becomes the current window, we want the
menubar to get all commandKey events. For this, we redefine the activate and
deactivate handlers as follows:
on activate of me (a MyControlPanel)
-- It is important to call the next handler!
do inherited
set the currentCommandKey of the System to theMenubar
end activate
Now, whenever the user presses a key and the command key, a commandKeyEvent is
sent to theMenubar (the commandKeyEvent of Menubar actually finds a menuItem
matching the key and invokes its menuSelect handler).
Since we don't want the menubar to get commandKeyEvents when the window is no
longer active, we should set the currentCommandKey of the System to False when the
window deactivates.
on deactivate of me (a MyControlPanel)
-- It is important to call the next handler!
do inherited
set the currentCommandKey of the System to false
end deactivate

See Also

currentCommandKey of System .

connect of Actor
connect me, endActor
with theconnector
with newconnector
The connect handler connects the actor and the endActor with the specified connector.
When two actors are connected, a connector is drawn from one to the other. The
connector's ends stay with the actors when the actors move. The actor becomes the
startActor of the connector and endActor becomes the endActor of the connector.

The connect handler lets you provide a connector to use for the connection or specify a
connector to make a child of. The two optional arguments, theConnector and
newConnector, are used for this purpose. When newConnector is False , no connector is

Page 58
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o n n e c t e d o f A c t o r

created and the connection is made using the connector passed as theConnector. Thus,
theConnector should be provided in this case.

me (an Actor)
endactor (an Actor)
[with theconnector] (a Connector or [[False]]): If False , a child of
Connector is made. Otherwise, a child of theConnector specified is
made.
[with newconnector] (a boolean): If True , a new connector is made to make
the connection.

Example
Let RandomConnector be a rectangle that on mousedown , connects two actors in its
contents at random. The simplest thing we can do is use a new connector each time. We
define the mouseDown handler below.
The call to connect in the handler below creates a new child of Connector and uses it
for the connection. Thus, each time we mousedown an extra connection is added to the
RandomConnector.
on mousedown of me (a RandomConnector)
set theContents to my contents
-- pick the first actor and remove it from the list.
set startActor to any item in theContents
remove startActor from theContents
-- pick the second actor.
set endActor to any item in theContents
-- Connect them!
connect startActor, endActor
end mousedown
We might want just one connection to exist, and keep changing it to other actors each time
we mousedown. We might have a connector set aside just for this purpose, called
oneConnector. To achieve, this we need to replace the last line of the handler with
connect startActor, endActor
with theConnector oneConnector
with newConnector False
Notice that if newConnector had been True , the connection would have been made
with a child of the connector specified in the theConnector argument (oneConnector
in this case).

connected of Actor
connected me, otheractor, theconnector

Page 59
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o n n e c t e d a c t o r s o f A c t o r

This event is sent by SK8 to the two connected actors and after they have been
successfully connected by connect . OtherActor is the actor to which it has been
connected and theConnector is the connector used for the connection.

me (an Actor)
otheractor (an Actor)
theconnector (a Connector)

Example
Consider an Actor, called startPoint , that does not want to be at the end of any
connection (it does not want to be the endActor of any connector). This can be done by
defining its connected handler to reverse a connection just made when the actor is at the
wrong end of it.
on connected of me (a startPoint), otherActor, theConnector
if theConnector's endActor = me then
reverseConnection theConnector
end if
end connected

See Also

connect , reverseConnection .

connectedactors of Actor
connectedActors me
Returns all actors that are directly connected through connectors to the specified actor.

me (an Actor)

connectedfrom of Actor
connectedFrom me
When a connection is made with connect , the first actor becomes the startActor of the
connector and the second becomes the endActor. Thus, the connection can be seen as
directional: going from the startActor to the endActor.
The connectedFrom handler exploits this directionality. It gets all of the actor's
connectors whose endActor equals the actor and returns all the actors at the other end:
the startActors from which this actor is connected.

me (an Actor)

Page 60
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o n n e c t e d t o o f A c t o r

Example
Consider an interval-based circuit simulation. At each time interval, each component
checks its inputs and computes its outputs. The connections can be implemented with
connectors. If the component is an AndGate , we would write the following handler:
on computeValue of me (an AndGate)
-- get the outputs of the components hooked up to the gate.
set inputs to the output of every item in my connectedFrom
-- Find out if there are any zeroes
repeat with oneValue in inputs
if oneValue = 0 then
set zeroFound to true
exit repeat
end if
end repeat
-- now set the output property.
if zeroFound then
set my output to 0
else
set my output to 1
end if
end computeValue

See Also

connect , startActor, endActor, connectedTo , connectors .

connectedto of Actor
connectedTo me
When a connection is made with connect , the first actor becomes the startActor of the
connector and the second becomes the endActor. Thus, the connection can be seen as
directional: going from the startActor to the endActor.
The connectedTo handler exploits this directionality. It gets all of the actor's connectors
whose startActor equals the actor and returns all the actors at the other end: the
endActors to which this actor is connected.

me (an Actor)

Example
Consider an actor called Colorizer that sets the fillcolor of every item it's connected to
to its fillcolor. For this, we redefine the set fillcolor handler as follows:

Page 61
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o n n e c t o r s o f A c t o r

on set fillcolor of me (a Colorizer) to newValue


-- call the next handler to set the color!
do inherited
set the fillcolor of every item in my connectedTo to newValue
end set fillcolor

See Also

connect , startActor, endActor, connectedFrom , connectors .

connectors of Actor
connectors me
Returns all the connectors that connect the specified actor to its connected actors.

me (an Actor)

containedby of Actor
containedBy me, otheractor
ContainedBy returns otherActor if Actor is contained (directly or indirectly) by
otherActor; otherwise, False is returned.

me (an Actor)
otheractor (an Actor)

containers of Actor
containers me
Returns the list of containers of the object. This is constructed by walking up the
containment hierarchy from the actor to it's window. Note that this will not include the
stage.

me (an Actor)

copyselectiontoclipboard of Actor
copySelectionToClipBoard me
This handler gets called when the actor is the keyTarget of the active window and the
user keys COMMAND-C (or selects "Copy" from a menu item). The default handler does
nothing.

Page 62
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c u t s e l e c t i o n t o c l i p b o a r d o f A c t o r

me (an Actor)

cutselectiontoclipboard of Actor
cutSelectionToClipBoard me
This handler gets called when the actor is the keyTarget of the active window and the
user keys COMMAND-X (or selects "Cut" from a menu item). The default handler does
nothing.

me (an Actor)

deactivate of Actor
deactivate me
Deactivate is called when the Actor ceases to be the active window. You can use this
handler to provide a visual indication that your window is no longer the selected window.

me (an Actor)

Example
It could be a convention of your favorite window system to show that windows are active
by setting their framecolor to uiRectangleOutBevel , a BevelRenderer. When
windows deactivate, their framecolors are set to Black . To make this happen, we redefine
the deactivate handler of an imaginary rectangle called compliantWindow.
on deactivate of Object (a CompliantWindow)
-- It is important to call the next handler!
do inherited
-- Now set the frameColor to Black
set my framecolor to Black
end deactivate

See Also

activate .

deactivatetext of Actor
deactivateText me
The deactivateText handler is called when the actor ceases to be the keyTarget of its
window or when the Actor is the keyTarget and its window ceases to be the active
window. The default deactivateText does nothing.

Page 63
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d e c r e m e n t O w n s R e g i o n C o u n t o f A c t o r

me (an Actor)

See Also

keyTarget .

decrementOwnsRegionCount of Actor
decrementOwnsRegionCount me
Indicates that ownsRegion no longer needs to return True and ownedRegion no longer
needs to be maintained. The ownsRegion property may still return True if other code
has called incrementOwnsRegionCount but has not yet called
decrementOwnsRegionCount .

me (an Actor)

See Also

incrementOwnsRegionCount , ownsRegion , ownedRegion

deepcontents of Actor
deepContents me
Returns a list, including the actor, and all the actors contained by it (directly and
indirectly).

me (an Actor)

deeplyvisible of Actor
deeplyVisible me
Returns whether the actor and all its containers up the containment hierarchy are
visible . Note that visible means "not hidden by the user". Thus, an actor that is
obstructed by others is still visible (although its visible property is set to True ).

me (an Actor)

See Also

visible .

Page 64
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d i s c a r d o f A c t o r

discard of Actor
discard me
Removes the actor from its container and calls the inherited handler to add the actor to
the recycled list.

me (an Actor)

See Also

recycled , new, compactSK8 and Chapter “SK8 Object System” for information on
recycling SK8 objects.

disconnect of Actor
disconnect me, otheractor
with disposeconnector
The disconnect handler disociates the connector from the two actors it connects. An
error is reported if the two actors are not connected.

me (an Actor)
otheractor (an Actor)

doubleclick of Actor
doubleClick me
A doubleClick event is sent to an actor whenever the user double clicks the mouse
button on it. A doubleclick event is defined as the user pressing and releasing a mouse
button over an actor twice. The time allowed between the press and the release of the
mouse button varies according to a setting made in the Macintosh control panel.
The default behavior for double clicking on and actor object is to pass the doubleClick
event on to the actor's container.
Note: The default mouseUp handler of Actor determines whether a doubleClick
event should be generated by taking into consideration the time elapsed between
mouseDown and mouseUp and the actor's doubleClickStyle . If you are not getting
doubleClicks make sure the default mouseUp of Actor is being called and the
doubleClickStyle is set properly.◆

me (an Actor)

See Also

mouseUp and doubleClickStyle .

Page 65
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d r a g o f A c t o r

drag of Actor
drag me
with otheractors
with live
with dropevents
with draggedoverevents
with draggingmousewithinevents
with onstage
with constrainingrect
The drag handler is called to allow the user to drag one or more actors. After invoking the
drag handler, the actor's location is set to the pointer location of the next mouseUp.

me (an Actor)
[with otheractors]: A list of other actors which should be dragged along with
the dragged actor (if no other actors should be dragged, the otherActors
argument should be False ).
[with live]: A Boolean value that indicates whether the drag should be live,
or whether only the grayed outline of the dragged actor(s) should be
dragged.
[with dropevents] (a boolean): If True , when the drag ends, a dropEvent is
sent to the frontmost actor that accepts drop events under the mouse.
[with draggedoverevents] (a boolean): If True , then every time the dragged
actor enters another actor that actor gets a draggingMouseEnter. When
it leaves it gets a draggingMouseLeave.
[with draggingmousewithinevents] (a boolean): If True , the
draggingMouseWithin is continuously sent to the actor under the actor
being dragged. DraggedOverEnter and draggedOverLeave events are
sent too.
[with onstage] (a boolean): If True , the actor pops up on the Stage to be
dragged as a window. Only one actor at a time can be dragged this way.
At the end of the drop the actor returns to its original location and
container.
[with constrainingrect]: A list of 4 integers specifying a rectangle (in Stage
coordinates). The actor that is being dragged will be constrained to be
always within this rect.

Example
Since any dragging operation ends as soon as the mouse button is released, it is common
to call this handler on mousedown . The mouseDown handler is shown below.
on mousedown of me (a DragEagerActor)
drag me
end mousedown
Notice that all actors contained by the DragEagerActor will be automatically dragged
with it, thanks to the containment hierarchy. For an interesting effect, try to provide as

Page 66
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d r a g g i n g m o u s e e n t e r o f A c t o r

otherActors a list containing things inside the actor being dragged. For example, if the
DragEagerActor has contents, you could replace the drag line of the handler by
drag me with otherActors {item 1 in my contents}

draggingmouseenter of Actor
draggingMouseEnter me, actordragged
This handler is called when a drag (with draggedOverEvents or with
draggingMouseWithinEvents ) is in process and the actorDragged enters the Actor's
bounds.

me (an Actor)
actordragged: The actor being dragged over me.

See Also

drag .

draggingmouseleave of Actor
draggingMouseLeave me, actordragged
This handler is called when a drag (with draggedOverEvents or with
draggingMouseWithinEvents ) is in process and the actorDragged leaves the Actor's
bounds.

me (an Actor)
actordragged: The actor being dragged above me.

See Also

drag .

draggingmousewithin of Actor
draggingMouseWithin me, actordragged
This handler is repeatedly called when actorDragged is being dragged above the
bounds of Actor. Note that this handler will only be called if you call drag with
draggingMouseWithinEvents .

me (an Actor)
actordragged

Page 67
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d r o p o f A c t o r

See Also

drag .

drop of Actor
drop me, droprecipient
When you call drag with dropEvents , the drop event is sent to the actor being dragged.
The default handler just sends the dropped event to the drop recipient (the actor right
under the actor being dragged).

me (an Actor)
droprecipient: The actor under the mouse at the place where the mouse
went up.

Example
The most common thing we want to do after a drop event is to set the container of the
droppedActor to the actor. We also want to preserve the physical location that the
droppedActor had just before the drop took place, so that there is no visible "jump"
when the drop takes place. To make this happen, we have to get the physical location
before we change the container of the droppedActor and restore it after we change the
container. We define a dropped handler on an actor called DropMagnet .
Note that it is necessary to lock the new container in order to avoid showing the change
of location.
on dropped of me (a DropMagnet), dropee
lock me
set {h,v} to the location of dropee with physical
set the container of the dropee to me
set the location of the dropee with physical to {h,v}
unlock me
end drop

See Also

dropped and drag .

dropped of Actor
dropped me, droppee
Dropped is called to tell actor that the droppee is being dropped into it (typically at the
end of a drag process). It is the responsibility of the actor to change the container of the
droppee if wanted. The default handler does nothing.

Page 68
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e n t e r i n g s t a g e o f A c t o r

me (an Actor)
droppee (an Actor)

See Also

drop for an example.

enteringstage of Actor
enteringStage me
Called when the actor is about to appear on the Stage . The default handler does nothing.
This handler is provided to allow you to do low level set up which very rarely will need
to be done.
Note: This handler is for advanced, low level users only. If you redefine it, keep in mind
that you cannot do anything in it that would force a graphical update of your actor (or
any of its containers). So, changing boundsrects, setting fillcolors, etc. is not advisable.
Operations at that higher level can be done by redefining the set container handler.◆

me (an Actor)

fillboundsrect of Actor
fillBoundsRect me
with physical
Returns the boundsRect of the Actor's fillRegion in Stage coordinates.

me (an Actor)
[with physical]

forceredraw of Actor
forceRedraw me
The forceRedraw handler forces the actor to completely redraw itself and its contents. In
addition to this, all actors in the deepContents of the actor (and the actor itself too) will
recompute all their regions.
Note: You should have a good reason for calling this handler since it is expensive! It
recomputes and redraws everything below the actor you specify. For most cases,
lightForceRedraw is a better choice.◆

me (an Actor)

Page 69
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
g e t s h a p e f r o m u s e r o f A c t o r

See Also

lightForceRedraw, sendUpdateEvent .

getshapefromuser of Actor
getShapeFromUser me
with starth
with startv
with style
with shiftconstraint
with multipledraw
with boundsrectset
Provides a direct manipulation interface to specifying the boundsRect of an actor. This
handler, which should be called from mouseDown only, starts drawing an outline of an
actor from the start point (or the location of the mouse). When the mouse is released, the
resulting boundsRect is returned. You can see this handler in operation each time you use
a tool from the DrawPalette to draw an actor.
If the start point is not specified, the mouseLoc of the Stage is used.

me (an Actor)
[with starth] (an Integer): The horizontal position of the start point in Stage
coordinates.
[with startv] (an Integer): The vertical position of the start point in Stage
coordinates.
[with style]: Specifies how the drawing of the rect outline will take place.
Options are 'centerOut' and 'cornerToCorner' .
[with shiftconstraint] (a boolean): If True , constraints the boundsrect to be a
square.
[with multipledraw] (a boolean): If True allows drawing of multiple actors.
[with boundsrectset] (a boolean): If True , sets the boundsRect of the Actor
(me) to the boundsRect specified by the user.

hascontents of Actor
hasContents me
Returns True if the actor has any contents.

me (an Actor)

hide of Actor
hide me

Page 70
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h i t b y m o u s e o f A c t o r

The hide handler makes the actor specified in the argument invisible by setting its
visible property to False . Contained actors disappear because their container is
invisible. This handler does not, however, change the visible property of the contained
actors.

me (an Actor)

Example
hide Actor

See Also

set visible .

hitbymouse of Actor
hitByMouse me, x, y
The hitByMouse handler is called by the system to check whether actor has been hit by
the mouse when the actor's mouseSensitivity is 'custom' and the location of the
event falls within the actor's bounds. The h and v arguments are given in Stage
coordinates.
By redefining this handler it is possible to specify in arbitrary ways whether the actor is
visible to the event system or not. The hitByMouse handler should return True or
False .

The default handler returns False .

me (an Actor)
x (an Integer): A horizontal point in Stage coordinates.
y (an Integer): A vertical point in Stage coordinates.

Example
Consider an actor that is only visible to the event system when its fillcolor is Red .
First, we set its mousesensitivity to 'custom' and then we define the hitByMouse
handler.
set the mouseSensitivity of VisibleWhenRed to 'custom'
on hitByMouse of me (a VisibleWhenRed), h, v
if my fillcolor = Red then
return true
else
return false
end if
end hitByMouse

Page 71
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h m o u s e o f A c t o r

See Also

mouseSensitivity.

hmouse of Actor
hMouse me
Returns a number that indicates the horizontal position of the mouse pointer based on the
actor's coordinate system. The actor must be contained by the Stage for hMouse to be
valid.
The coordinate system continues outside of the actor's boundaries, so even if the mouse
pointer is outside the actor, an appropriate value will be returned.

me (an Actor)

Example
get the hMouse of Actor

See Also

mouseloc .

idle of Actor
idle me
Idle events are sent by SK8 when the user is generating no events through the keyboard
or mouse, and when no handlers are running. The idle event is sent to every actor that is
on the Stage (or contained by an actor on the Stage ) and has its wantsIdle property
set to True .

me (an Actor)

Example
Consider a actor serving as a digital clock. Let's call it DigClock . DigClock is a rectangle
attached to the Stage whose text is the current time. DigClock 's wantsIdle property is
True , since DigClock needs idle events to update its text . We define the idle event
to set DigClock 's text to the current time (we use the Today object for this).
on idle of me (a DigClock)
set my text to Today's timeString
end idle

Page 72
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n c r e m e n t O w n s R e g i o n C o u n t o f A c t o r

See Also

wantsIdle , Today, Date .

incrementOwnsRegionCount of Actor
incrementOwnsRegionCount me
Indicates that ownsRegion is to return True and ownedRegion needs to be maintained.

me (an Actor)

See Also

decrementOwnsRegionCount , ownsRegion , ownedRegion

initialize of Actor
initialize me, original, isnew, initargs
The initialize method of Actor is called when the actor is being created. If first does the
inherited handler to let the object system create a new object. After that it does all the set
up required to make an actor. This involves copying all the contents of the original actor.
The handler creates and sets up connectors for any actors in its contents that are
connected.
It is common to redefine this handler to do any extra set up that may be required for your
actors. If you need to redefine it, make sure you do inherited before doing your own
set up.

me (an Actor)
original: Original is either the object which was passed to new or duplicate
to create a child or sibling, respectively.
child: Child is a boolean which is True when Object was created with new
and False when Object was created with duplicate.
args: Arguments is a list of property-value pairs which are passed to new or
duplicate to initialize the properties of Object.

Example
In SK8, when an object is created, all the values of its properties are initialized from the
values in the properties of the parent. If this mechanism was not in place already, we
could implement it in the initialize handler. For example, we can write an
initialize handler that makes sure the fillcolor of the new actor is the fillcolor
of the original. Let us call the actor that presents this behavior a "fillcolorInheritor ".

Page 73
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n i t i a l i z e f r o m s t o r e o f A c t o r

on initialize of Me (a fillcolorInheritor), original, child,


arguments
-- first let the system make the Actor.
do inherited
-- now copy the fillcolor
set my fillcolor to the fillcolor of original
end initialize

See Also

new, copy.

initializefromstore of Actor
initializeFromStore me
InitializeFromStore is called by the load handler on an object immediately after it
has been loaded by the object store loader. You can use initializeFromStore to
perform any special load-time intialization for your objects.
InitializeFromStore -- not initialize --is called at load-time. The difference
between the two is that an object is not created when loaded, but only brought into
memory.
InitializeFromStore is responsible for performing all initialization required for the
object to be functional (e.g., open media files). In the actor's case, it initializes the actor's
regions.

me (an Actor)

keydown of Actor
keyDown me, thechar
The keyDown handler is called when the user presses down on a key and the actor is the
keyTarget of its window.

me (an Actor)
thechar: The character pressed.

keyup of Actor
keyUp me, thechar
The keyUp handler is called when the user releases a key and the actor is the keyTarget
of its window.

Page 74
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l e a v i n g s t a g e o f A c t o r

me (an Actor)
thechar: The character that was pressed.

See Also

keyDown and keyTarget .

leavingstage of Actor
leavingStage me
This handler is called when the actor (or any of its containers) is about to be removed
from the Stage . It is provided to let you do low level clean ups when your actor leaves a
window.
Note: This handler is for advanced, low level users only. If you redefine it, keep in mind
that you cannot do anything in it that would force a graphical update of your actor (or
any of its containers). So, changing boundsrects, setting fillcolors, etc. is not advisable.
Operations at that higher level can be done by redefining the set container handler.◆

me (an Actor)

lightforceredraw of Actor
lightForceRedraw me
Forces the graphics system to redraw the actor without recomputing any of its regions (or
its contents's regions).

me (an Actor)

See Also

sendUpdateEvent , forceRedraw.

localVirtualProperties of Actor
localVirtualProperties me
Returns the local properties of this actor that are virtual (no space is allocated for them).

me (an Actor)

Page 75
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l o c k o f A c t o r

lock of Actor
lock me
Locking an actor prevents any graphical updates inside its window.
Calling this handler increases the lockLevel of the actor's window by 1. Graphical
updates only take place when the lockLevel becomes 0.
Note: setting the boundsRect of a window while it is locked forces the window to
unlock itself and update.◆

me (an Actor)

See Also

unlock ,locked , lockLevel .

locked of Actor
locked me
Specifies whether the Actor's is locked (its locklevel is not False ). When a window is
locked, no graphical updates are shown to the screen.

me (an Actor)

See Also

lock , lockLevel and unlock .

locklevel of Actor
locklevel me
Returns an integer indicating the number of times the actor's window has been locked. It
returns False when the actor's window is not locked. lock and unlock are used to
change the lockLevel .

me (an Actor)

See Also

lock and unlock .

logicaltophysical of Actor
logicalToPhysical me, h, v

Page 76
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l o g i c a l t o p h y s i c a l l i s t o f A c t o r

Translates a point in the local coordinate system of the actor to Stage coordinates.

me (an Actor)
h (a Number): A horizontal location in the actor's local coordinate system.
v (a Number): A vertical location in the actor's local coordinate system.

See Also

physicalToLogical .

logicaltophysicallist of Actor
logicalToPhysicallist me, coordslist
Translates each point in coordList into its corresponding point in physical (Stage )
coordinates.

me (an Actor)
coordslist: A list of numbers. The length of the list should be even. Each pair
is interpreted as an (h,v) point.

See Also

logicalToPhysical .

logicaltophysicalrect of Actor
logicalToPhysicalrect me, h1, v1, h2, v2
Returns a list of four integers specifying the physical rectangle that corresponds to the
logical rect specified.

me (an Actor)
h1 (a Number): The left of the logical rect.
v1 (a Number): The top of the logical rect.
h2 (a Number): The right of the logical rect.
v2 (a Number): The bottom of the logical rect.

See Also

logicalToPhysical .

makeboundsregion of Actor
makeBoundsRegion me

Page 77
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a k e fi l l r e g i o n o f A c t o r

The makeBoundsRegion handler recomputes the bounds region of the actor (the union
of the Actor's frame and fill regions). The default handler marks the boundsRegion as
valid and returns. The children of Actor all redefine this handler to specify their particular
geometries.
Note: calling boundsRegion to get the bounds region will call makeBoundsRegion if
the region is not up to date. Thus, you should not call the getter to get the region, and
should use getValue instead.◆

me (an Actor)

See Also

boundsRegionOk .

makefillregion of Actor
makeFillRegion me
Recomputes the fill region of the actor (the bounds region minus the frame region). Then
the region is marked as valid.
Note: calling fillRegion to get the fill region will call makeFillRegion if the region
is not up to date. Thus, you should not call the getter to get the region, and should use
getValue instead.◆

me (an Actor)

See Also

fillRegionOk .

makeframeregion of Actor
makeFrameRegion me
Recomputes the frame region of the actor (the bounds region minus the fill region) and it
marks it as valid.
The default handler computes the frameRegion by calling makeFillRegion to
compute the fillRegion . Then, the fill is subtracted from the bounds to get the frame.
Note: calling frameRegion to get the frame region will call makeFrameRegion if the
region is not up to date. Thus, you should not call the getter to get the region, and should
use getValue instead.◆

me (an Actor)

Page 78
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m i n i m u m s i z e o f A c t o r

See Also

frameRegionOk .

minimumsize of Actor
minimumSize me
Returns the minimumSize an actor can have as a list of 2 values. The setBoundsRect
handler will not let you shrink an actor beyond its minimumSize . To specify the
minimumSize , you must define a handler that returns a list of two values.

The default handler returns {2,2} .

me (an Actor)

Example
We can define a minimumSize of myActor as follows:
on minimumSize of me (a myActor)
return {20,30}
end minimumSize

See Also

setBoundsRect .

mousedown of Actor
mouseDown me
Mousedown is sent by SK8 whenever the pointer goes down on the actor.
Note: If the actor's autoHighlight property is set to True , then the actor will be
highlighted while the mouse button is down and the pointer is over the actor.◆

me (an Actor)

See Also

autohighlight , highlight and mouseSensitivity.

mouseenter of Actor
mouseEnter me
Mouseenter is called on the actor whenever the pointer enters the Actor's bounds. The
default handler does nothing.

Page 79
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o u s e l e a v e o f A c t o r

me (an Actor)

Example
There are a number of common things that occur when the mouse enters an actor. An
example would be to change the cursor. The EditText changes the cursor to the ibeam
cursor to show that text editing is allowed within itself. On mouseleave , it is good policy
to undo your changes. Thus, we could set the cursor of the Stage to the
StandardCursor.
on mouseEnter of me (a EditText)
set the cursor of the Stage to the iBeamCursor
end mouseEnter
on mouseLeave of me (a EditText)
set the cursor of the Stage to the StandardCursor
end mouseEnter

See Also

mouseSensitivity, set cursor of the Stage .

mouseleave of Actor
mouseLeave me
Called on the actor whenever the pointer leaves the actor's bounds.

me (an Actor)

See Also

mouseEnter for an example of using this handler.

mouseloc of Actor
mouseLoc me
Returns a two-item list of the logical mouse position in the specified actor's coordinate
system.
The coordinate system continues outside of the actor's boundaries, so even if the mouse
pointer is outside the actor, an appropriate value will be returned.
Note: The actor must be contained by the Stage for mouseLoc to be valid. Otherwise an
error is signaled.◆

me (an Actor)

Page 80
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o u s e u p o f A c t o r

Example
As an exploratory example, consider an actor whose text is its mouseloc . For that, let's
write a mouseDown handler that keeps setting the actor's text to its mouseLoc . Notice
the values of the mouseLoc when you move the mouse outside the bounds of the actor. It
would also be instructive to test our handler after changing the scale and the origin of
the mouseLocTester.
on mouseDown of me (a mouseLocTester)
repeat while the mouse is down
set my text to my mouseloc as a String
end repeat
end mouseDown

See Also

origin and scale .

mouseup of Actor
mouseUp me
Called on the actor whenever the pointer (a mouse, pen, or other pointing device) goes up
on it.
Note: The default mouseUp of Actor determines whether clicks or doubleClicks should
be dispatched. Thus, if you redefine this handler, you should do inherited if you want
these events to be generated.◆

me (an Actor)

Example
The mouseUp event is very convenient because it is always sent after a mousedown , a
click or a doubleclick . So, if you want something to happen when the mouse goes
down over an actor, without caring whether a click or a mousedown was generated,
mouseUp is the best thing to define.

An example would be a roundRect that plays a sound on mouseUp .


on mouseUp of me (a SoundButton)
-- Call the next handler to determine whether click
-- and doubleclick should be sent.
do inherited
play ModalSound
end mouseUp

mousewithin of Actor
mouseWithin me

Page 81
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o v e d o f A c t o r

The default mouseWithin handler does nothing. The mouseWithin event is


continuously sent by SK8 while the mouse is inside the actor, if the wantsMouseWithin
property of the actor is set to True .

me (an Actor)

moved of Actor
moved me
Sent by SK8 after an actor has been moved (i.e., has changed location but not size ) in
any way. The default moved handler makes sure all connectors move with the object.
Note: The moved event is sent by the setBoundsRect handler when the justMoving
argument is True .◆

me (an Actor)

See Also

setBoundsRect , resized .

moveoffstage of Actor
moveOffStage me
Sets the location of the actor to be off the Stage , i.e., off the currently visible monitor
space. This is useful when you want something to stay on the Stage (for example, if you
want it to remain the active window) but don't want it to be visible to the user. The actor
does not have to be a top level actor (or window).

me (an Actor)

See Also

moveOnStage .

moveonstage of Actor
moveOnStage me
Sets the location so that the actor is visible on Stage, i.e., on the currently visible
monitor space.

me (an Actor)

Page 82
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o v i e f y o f A c t o r

Example
moveOnStage Actor

See Also

MoveOffStage .

moviefy of Actor
moviefy me
with movie
with file
with logicalname
with physicalname
This gives actor the functionality required to play a quickTimeMovie by mixing it in to
movie or quickTimeMovie (if the movie is False ). The movie will then play in the fill
region of the actor.
Note: Note:
If theMovie is supplied, it is used; otherwise one is created.◆

me (an Actor)
[with movie]
[with file]
[with logicalname]
[with physicalname]

Example
Let us moviefy an Actor and play a movie in it. The first step is to create the actor (Any
actor would do). The second step is to moviefy it.
new rectangle with objectName "TheFilm"
moviefy theFilm
Now we place the actor on the Stage , or in some actor in the Stage . Our actor now
knows how to play movies. We need to link it to an actual QuickTime file and then play it.
linkMovieToFile theFilm
This handler will bring up a file dialog to help you look for the movie file. After it is
selected, you can play the movie using the play handler.
play theFilm
moviefy Actor with movie movie

Page 83
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
n e w c o n t a i n e r o k o f A c t o r

newcontainerok of Actor
newContainerOk me, newcontainer
The newContainerOk handler is one of the "consent" handlers called by set
container to check whether the containment change is acceptable. Both the new
container and the new content have to consent to the change in containers. This handler is
called before any containment change happens.

me (an Actor)
newcontainer: An actor, the Stage or False .

See Also

set container and newContentOK .

newcontentok of Actor
newContentOk me, newcontent
NewContentOk is one of the "consent" handlers called by set container to check
whether the proposed change in containment is acceptable. Both the new container and
the new content have to consent to the change in containers. This handler is called before
any containment change happens.

me (an Actor)
newcontent (an Actor)

See Also

set container and newContainerOK .

overlaps of Actor
overlaps me, otheractor
Returns True when the two actors are in the same container and their bounds overlap.

me (an Actor)
otheractor (an Actor)

Example
Consider a naughty rectangle called SocialMisfit that removes from its container
everything that is currently touching it. We can define a handler for it called
RadicallyAvoidContact as follows:

Page 84
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o w n s R e g i o n o f A c t o r

on radicallyAvoidContact of me (a SocialMisfit)
set possibleVictims to my container's contents
-- misfit but not stupid!
remove me from possibleVictims
repeat with poorGuy in possibleVictims
if overlaps me, poorGuy then
set poorGuy's container to false
end if
end repeat
end radicallyAvoidContact

ownsRegion of Actor
ownsRegion me
If ownsRegion returns True , the actor owns a region of the Stage for drawing. This
means that there is code which might draw into the Actor at other times than the normal
draw loop. Only a few actors know how to take advantage of this property (e.g.
EditText ). Setting it on other actors has no effect. It is provided for the advanced user to
allow the creation of custom actors that use the ownedRegion virtual property.
When ownsRegion is True , the graphics system makes sure to draw the actor every time
something in its window is drawn (this slows down all drawing in the window a bit). The
graphics system will also maintain in the ownedRegion property, the region that you
should clip to when you want to draw directly to the screen.
You will write a handler that updates your actor graphically directly (without invoking
the draw loop).
Note: This is a very advanced feature of SK8.◆

me (an Actor)

See Also

incrementOwnsRegionCount , decrementOwnsRegionCount , ownedRegion .

parthit of Actor
partHit me
with by
with target
PartHit returns True if the target region of actor includes the point specified in the by
argument.
Note: This is a more convenient way of calling pointOnWhichPart from SK8Script.◆

Page 85
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p a s t e c l i p b o a r d t o s e l e c t i o n o f A c t o r

me (an Actor)
[by]: A list of two integers, specifying a point in Stage coordinates.
[with target] (a Symbol): The part of the actor we want to test. Options are
'bounds' (the default), 'fill' , 'frame' and 'rect' .

See Also

pointOnWhichPart .

pasteclipboardtoselection of Actor
pasteClipBoardToSelection me
This handler is called to paste the contents of the SK8Clipboard into the Actor's
selection. The system will automatically send this message to the keyTarget of the active
window when the user selects "Paste" from a menu (or uses the key equivalent). The
default handler does nothing, since the concept of "selection" only applies to specific
actors.

me (an Actor)

See Also

keyTarget , getFromClipboard and pasteClipboardToSelection of EditText


for an example of how to redefine this handler.

physicalScale of Actor
physicalScale me
Returns the actor's physical scale, which is the product of my scale , the scale of
my container, and all of its container s.

me (an Actor)

See Also

scale , setScale , rescaled , zoom , hscale , and vscale .

physicaltological of Actor
physicalToLogical me, h, v
The physicalToLogical handler translates a point expressed in Stage coordinates to
the logical coordinate system defined by the actor.

Page 86
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p h y s i c a l t o l o g i c a l l i s t o f A c t o r

me (an Actor)
h (an Integer): A horizontal position in the Stage coordinate system.
v (an Integer): A vertical position in the Stage coordinate system.

See Also

logicalToPhysical .

physicaltologicallist of Actor
physicalToLogicallist me, coordslist
Translates each point in coordList into its corresponding point in logical coordinates.

me (an Actor)
coordslist: A list of numbers. The length of the list should be even. Each pair
is interpreted as an (h,v) point.

See Also

physicalToLogical .

physicaltologicalrect of Actor
physicalToLogicalrect me, h1, v1, h2, v2
Returns a list of four numbers specifying the logical rectangle that corresponds to the
physical rect specified.

me (an Actor)
h1 (an Integer): The left of the physical rect.
v1 (an Integer): The top of the physical rect.
h2 (an Integer): The right of the physical rect.
v2 (an Integer): The bottom of the physical rect.

See Also

physicalToLogical .

pointonwhichactor of Actor
pointOnWhichActor me, x, y
with deep
Finds the frontmost actor, contained by the actor, whose boundsRegion contains the
point {x,y} .

Page 87
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p o i n t o n w h i c h p a r t o f A c t o r

me (an Actor)
x (an Integer): A horizontal position in Stage coordinates.
y (an Integer): A vertical position in Stage coordinates.
[with deep] (a boolean): If True , we search the deepContents of me.
Otherwise, we only look in the immediate contents of the actor.

pointonwhichpart of Actor
pointOnWhichPart me, x, y
with part
This handler is called when the user wants to figure out if a point falls within some part of
an actor. The point has to be provided in Stage coordinates. If the point falls within the
part specified, the part is returned. Otherwise False is returned.

me (an Actor)
x (an Integer): A horizontal location in Stage coordinates.
y (an Integer): A vertical location in Stage coordinates.
[with part] (a Symbol): The part of the actor we want to test. Options are
'bounds' (the default), 'fill' , 'frame' and 'rect' .

See Also

partHit which provides a simpler interface to this handler.

preparefornewcontainer of Actor
prepareForNewContainer me, newcontainer
This handler is called to allow the actor to do any extra set up required to be added to
newContainer. The default handler does nothing.
If newContainer is False , the actor is being removed from its container. Otherwise,
newContainer is an actor.

Note: The Preparefornewcontainer handler gets called before the actor actually is
drawn so that any changes will be done behind the scenes.◆

me (an Actor)
newcontainer: An actor or False .

Example
As an example, consider an actor that wants to become Green when added to ovals and
Red when added to rectangles. We would define this handler as follows:

Page 88
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p r e p a r e f o r n e w c o n t e n t o f A c t o r

on prepareForNewContainer of (me (an Actor), newContainer)


-- only do all this if newContainer is not false.
if newContainer
if (newContainer is an Oval) then
set my fillcolor to green
else if newContainer is a Rectangle then
set my fillcolor to Red
end if
end if
end if
end prepareForNewContainer

preparefornewcontent of Actor
prepareForNewContent me, newcontent
With prepareForNewContent , the new container gets a chance to update itself. If
newContent is False , it means that an actor was removed from the actor.

me (an Actor)
newcontent: An actor or False .

See Also

boundedByContents .

preserve of Actor
preserve me
Preserve is applied to the actor when you create your own standalone SK8 environment
using "Build Standalone". You may specialize preserve to perform any clean-up for your
objects before they are saved as part of a standalone SK8 application.

me (an Actor)

See Also

restore and the utility function buildStandalone .

removeconnector of Actor
removeConnector me, theconnector
Removes theConnector from the actor's connectors. This handler is called by the
disconnect handler.

Page 89
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e m o v i n g m e a s p a r e n t o f A c t o r

me (an Actor)
theconnector

See Also

disconnect .

removingmeasparent of Actor
removingMeAsParent me, child, newparents
This handler gets called when child is about to cease being an actor (ie. removeParents
will be called). The default handler makes sure the child is removed from any containers
and then removes everything is has that has to do with being an actor.

me (an Actor)
child: The objects that is about to cease being an actor.
newparents

See Also

removeParents , changeParents , addedMeAsParent .

rescaled of Actor
rescaled me
This is called whenever the physicalScale of the actor is changed. This can happen as
a result of a direct call to setScale or a change in containment.
The event is forwarded to any DynamicRenderer s associated with the actor.

me (an Actor)

See Also

scale , physicalScale .

resetcoordinates of Actor
resetCoordinates me
Sets the actor's origin to {0,0} and then sets the actor's scale to {1,1} .

me (an Actor)

Page 90
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e s i z e o f A c t o r

See Also

setOrigin and setScale .

resize of Actor
resize me, how
with live
with otheractors
The resize handler is called when the user begins to resize an actor with the mouse.
Note: If otherActors are specified, the resizing is done non live.◆

me (an Actor)
how: Specifies which part of the actor's boundsRect the user is going to grab
for resizing. Options are 'top' , 'bottom' , 'left' , 'right' ,
'bottomRight' , 'bottomLeft' , 'topLeft' , 'topRight' .
[with live] (a boolean): If True the actor's total image will be constantly
re-drawn as the user moves the mouse for resizing. If False only the
outline of the actor's image will be constantly re-drawn as the user
adjusts the object to a new size. If this argument is not specified, we
resize live when the optionKey is down.
[with otheractors]: A list of actors to be resized at the same time.

resized of Actor
resized me
The resized event is sent each time an actor's boundsRect is set with the justMoving
flag set to False (the default). The default resized handler ensures that any connectors
stay connected at the right places and that the container resizes itself if it is bounded by
contents.
You can modify the resized handler to create special behaviors whenever a resized
event occurs. A titlebar, for example, would always want to span the whole width of its
container. The container, then, can use the resized handler to make sure that each time it
changes size, the titlebar does too.
It is good object-oriented programming style, of course, to encapsulate the knowledge
required to resize an object in the object itself. Thus, whenever the actor gets resized, it
calls the bestSize handlers for each item in its contents. Through the bestSize
handler, then, each object knows how to resize itself.

me (an Actor)

Page 91
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e s t o r e o f A c t o r

Example
Consider a rectangle called myRect containing a title bar called myTitle . First we make
the resized handler call bestsize for each item in it.
on resized of me (a myRect)
-- first call the next handler to keep connectors
-- in synch...
do inherited
-- now let each actor in my contents resize itself
repeat with oneActor in my contents
bestsize oneActor
end repeat
end resized
Then we define a bestSize handler on the titlebar that will snap it to the right place by
setting its width to the width of its container (preserving the height of the titlebar and
placing the top left corner at {0,0} ).
on bestSize of me (a myTitle)
set newWidth to the width of my container
set my boundsRect to {0,0, my height, newWidth}
end bestSize

See Also

bestSize , setBoundsRect .

restore of Actor
restore me
Called to an actor when it is reconstituted when SK8 loads. Restore is invoked only on
objects that you have explicitly saved by creating your own standalone SK8 application.

me (an Actor)

See Also

preserve and the utility function buildStandalone .

savetostore of Actor
saveToStore me, property
This handler is called when the ctor's property has to be saved. The default method does
nothing.

me (an Actor)
property: The property being saved.

Page 92
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s c r o l l o f A c t o r

scroll of Actor
scroll me, x, y
with forceredraw
The scroll handler adds x and y to the current hOrigin and vOrigin respectively. Calls
setOrigin to do the work.

me (an Actor)
x (a Number)
y (a Number)
[with forceredraw] (a boolean)

Example
Let's write a handler that detects the change in the mouse location and scrolls the actor
under the mouse by the same amount.
on mouseDown of me (a ScrollingRect)
set {h,v} to the mouseLoc of the Stage
repeat while the mouse is down
set {newH, newV} to the mouseloc of the Stage
-- only scroll if the mouseLoc has changed.
if newH ≠ h or newV ≠ v then
scroll me, h - newH, v - newV
end if
set h to newH
set v to newV
end repeat
end mouseDown

See Also

setOrigin .

selectall of Actor
selectAll me
This handler is called when the user keys COMMAND-A and the actor is the keyTarget
of the active window. The default handler does nothing.

me (an Actor)

sendfarther of Actor
sendFarther me

Page 93
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e n d t o b a c k o f A c t o r

The sendfarther handler moves the actor closer to the bottom of its container's contents.
This is accomplished by raising the actor's layer property by one (if the actor is not
already the bottommost actor in its window).

me (an Actor)

See Also

set layer, bringCloser, bringToFront and sendToBack .

sendtoback of Actor
sendToBack me
The sendtoback handler moves the actor to the deepest layer of its container.

me (an Actor)

See Also

layer, bringCloser, bringToFront and sendFarther.

sendUpdateEvent of Actor
sendUpdateEvent me
This handler tells the graphic system to make sure that the actor has done all of it's
drawing. This is useful when you are writing a tight loop moving windows around the
screen and the graphic system is unable to get a chance to refresh the windows.
Therefore, if you ever are whizzing windows around and things don't look right, try
calling this handler on each window you wish to refresh.
Note this is different from forceRedraw and lightForceRedraw. Those two functions
tell the graphic system that the windows need to be refreshed. sendUpdateEvent forces
the windows to be refreshed.

me (an Actor)

setboundsrect of Actor
setBoundsRect me, left, top, right, bottom
with physical
with relative
with justmoving

Page 94
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e t b o u n d s r e c t o f A c t o r

The boundsRect property determines the location of an actor's four corners, and
therefore determines the size and location of the actor. This handler sets the actor's
boundsRect.
If you change the boundsRect of the actor without changing its size, set justMoving to
True . This allows setBoundsRect to internally optimize the speed in which the actor is
moved. If you incorrectly set justMoving to True but nonetheless change the size of the
actor, you may experience some redraw problems.
Also, if justMoving is True , a moved event is sent to the actor. Otherwise, a resized
event is sent.
Note: If the boundsRect specified is smaller than the actor's minimumSize , the
boundsRect is set to the minimumSize .
This is the handler that is called when any actor changes size , location or both. If you
want to intercept any of these property changes, redefining setBoundsRect is the way
to do it.◆

me (an Actor)
left (a Number): The horizontal position of the left of the actor's boundsRect.
top (a Number): The vertical position of the top of the actor's boundsRect.
right (a Number): The horizontal position of the right of the actor's
boundsRect.
bottom (a Number): The vertical position of the bottom of the actor's
boundsRect.
[with physical] (a boolean): If True , the values supplied are assumed to be
in physical (Stage ) rather than logical coordinates. The default is
False .
[with relative] (a boolean): If True , this handler interprets the four values as
offsets from the current values. The default is False .
[with justmoving] (a boolean): Whether the actor is going to change size as
a result of this operation. If the actor will not change size, this argument
should be True .

Example
Consider a rectangle called FlakyRect that shrinks by one pixel in every direction while
the mouse is down on it. If the optionKey is down, it expands by one pixel each time.
Suppose we have placed FlakyRect in a rectangle on the Stage . We start by setting its
boundsRect :
set FlakyRect's boundsRect to {100,100,200,200}
Now suppose that we aren't satisfied with its present position, and would like to move it
so that its location was {200,200} . We can say:
set FlakyRect's boundsRect to {150,150,250,250} with justMoving
Notice that the justMoving argument was specified. By doing this, we tell the system
that the actor is not changing size, allowing the system to carry out a number of

Page 95
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e t f r a m e s i z e o f A c t o r

optimizations which let this handler perform slightly better. Notice also that in this
example a moved event would be sent to FlakyRect .
Next, we define the mousedown handler to shrink or expand our FlakyRect . We set the
boundsRect relative to the current boundsRect to add or subtract a pixel from each
side.
on mouseDown of me (a FlakyRect)
repeat while the mouse is down
if optionKeyDown() then
-- shrinking!
set my boundsRect with relative to {1,1,-1,-1}
else
-- expanding!
set my boundsRect with relative to {-1,-1,1,1}
end if
end repeat
end mouseDown

See Also

minimumSize .

setframesize of Actor
setFrameSize me, h, v
with physical
Sets the frame size of the Actor to h and v.

me (an Actor)
h (a Number)
v (a Number)
[with physical] (a boolean): If True , h and v are assumed to be given in
physical coordinates.

setlocation of Actor
setLocation me, x, y
with relative
with physical
Changes the actor's boundsRect so that its center is the point {x,y} .
SetLocation calls setBoundsRect with justMoving set to True so that a moved
event is send to the actor and other optimizations may be made.
Note: Since the location is a virtual property, computed from the actor's boundsRect ,
a change in boundsRect might change the location without calling setLocation .
Thus, if you want to catch any change of location of you actor, you should redefine
setBoundsRect .◆

Page 96
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e t o r i g i n o f A c t o r

me (an Actor)
x (a Number)
y (a Number)
[with relative] (a boolean): If relative is True , the current location is
offseted by x and y.
[with physical] (a boolean): If True , it is assumed that x and y are in
physical coordinates.

See Also

setBoundsRect and location .

setorigin of Actor
setOrigin me, xorigin, yorigin
with forceredraw
Moves the point in the local coordinate system of the actor specified by
{xOrigin,yOrigin} to the topLeft of the actor's boundsRect . As a result, the entire
contents of the actor pans to accommodate the new origin.
Note: If the forceRedraw argument is False the system optimizes the operation
making it considerably faster. There are a number of circumstances, however, in which
this optimization results in draw errors.
In particular, the actor to be panned should not be covered in any part by any actors in its
window, and it should have no text. Also the actor (or anything in it) may not be rendered
with renderers that do not render masks uniformly (like an imageRenderer that paints a
PICT as opposed to something like Red ).
In general, a redraw error when panning is a clear indication that you cannot use this
optimization and thus should call this handler with the forceRedraw argument set to
true .◆

me (an Actor)
xorigin (a Number)
yorigin (a Number)
[with forceredraw] (a boolean): If True (the default) , everything in the actor
is redrawn.

Example
Setting the origin property effectively moves the specified point to the upper-left corner
of the container. As a result, actors inside the container will pan vertically and/or
horizontally to fit within the new coordinate system. For example, setting the origin of a
container (whose origin is currently set to {0,0} ) to {-5, 5} will move all contained
actors 5 logical units to the right and five vertical units up. Until the origin is again

Page 97
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e t s c a l e o f A c t o r

changed, the point at the actor's boundsRect 's upper-left corner would have a value of
{-5,5} .

See Also

set hOrigin , set vOrigin .

setscale of Actor
setScale me, xscale, yscale
Sets the actor's scale . The default scale is {1,1} . A scale of 1 means that if the logical
width of an actor in the Actor's contents equals 100, that actor is 100 pixels wide. Setting
the scale to 2 doubles the number of pixels required per logical unit (the actor would be
200 pixels wide).

me (an Actor)
xscale: A positive number.
yscale: A positive number.

See Also

set hScale and set vScale .

setsize of Actor
setSize me, h, v
with physical
with relative
Sets the Actor's width and height to h and v respectively.
SetBoundsRect is called to do the work. If the size specified is smaller than the
minimumSize , the size is set to the minimumSize .

Note: If the one of the components of the new size is odd and physical is True , it is not
guaranteed that the actor will keep its physical location constant. The physical size,
however, will be the exact size specified.◆

me (an Actor)
h (a Number)
v (a Number)
[with physical] (a boolean): If True , h and v are assumed to be given in
Stage coordinates.
[with relative] (a boolean): If True , h and v are added to the current width
and height to compute the new size .

Page 98
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s h o w o f A c t o r

See Also

setBoundsRect and minimumSize .

show of Actor
show me
Shows the actor specified in the argument by setting its visible property to True . The
show handler also makes visible any contained actors whose visible property is set to
True .

me (an Actor)

See Also

set visible .

shown of Actor
shown me
Returns True if the actor is on the Stage and it is currently visible by the user (i.e., when
nothing is obstructing it from view). Note that the actor is considered shown if any part of
its boundsRect is shown.
Note: This is not the same as the visible property, since an actor's visible could be
True but the actor could be covered by other actors or be clipped out by some container.◆

me (an Actor)

Example
We might want to implement an egocentric actor that always wants to be visible. This
actor will start complaining, by beeping, as soon as it ceases to be visible. It uses the
shown property to check whether it is still showing. Let us call this actor Narcissus . We
set its wantsIdle property to True and define its idle handler.
set the wantsIdle of Narcissus to true
on idle of me (a Narcissus)
if I'm not shown then
beep
end if
end idle

Page 99
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t a b t o n e x t a c t o r o f A c t o r

tabtonextactor of Actor
tabToNextActor me
with direction
TabtoNextActor is invoked when the user presses the tab key and the keyTarget 's
autotab is True . It searches the contents of its container for the next actor whose
autotab property is set to True .

If direction is 'forward' we search from the current keyTarget to the bottom layer.
Otherwise we search up. The search wraps if nothing is found. If an actor other than itself
is found, the keyTarget of its window is set to it.

me (an Actor)
[with direction]: 'forward' or 'backward' .

Example
Consider a window with several autotab actors in it. Elroy and Jake are two of these
actors. They are on a mission from God : to keep the keyTarget to themselves. Clearly,
the tabToNextActor handler needs to be redefined as follows.
on tabToNextActor of me (an Elroy) with direction
set the keyTarget of my window to Jake
end tabToNextActor
on tabToNextActor of me (a Jake) with direction
set the keyTarget of my window to Elroy
end tabToNextActor
Notice that as soon as Jake or Elroy become the keyTarget , they will keep alternating
as keyTargets until the user desists of using the tab key to reach other actors.

See Also

keyTarget , autoTab .

unlock of Actor
unlock me
with thevisualeffect
with effectspeed
with force
Subtracts 1 to the lockLevel of the actor's window. If the locklevel becomes 0, it is set
to False and the window redraws. If a visualEffect is supplied, it is used for the redraw.

Page 100
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
v m o u s e o f A c t o r

me (an Actor)
[with thevisualeffect] (a VisualEffect)
[with effectspeed]: The speed at which the VisualEffect will run. Options are
'fast' , 'normal' and 'slow' .
[with force]: Whether the window should be unlocked all the way causing a
redraw.

Example
Let's unlock an actor with a visualEffect. A nice demo handler is demoEffects . Given an
actor, it changes its fillcolor and applies a random visual effect each time it unlocks. It
keeps going until the mouse goes down on something.
A particularly satisfying VisualEffect to watch for is any one of the four members of the
FanHouse family. The four members are FanHouseDown , FanHouseUp , FanHouseLeft ,
and FanHouseRight .
on demoEffect of me (an Actor)
repeat while the mouse is up
set theColor to any item in the knownChildren of RGBColor
set theEffect to any item in the knownChildren of visualEffect
lock me
-- Now do any graphical changes.
set my fillcolor to theColor
set my text to theEffect's objectString
-- unlock the actor using a visual effect.
unlock me with theVisualEffect theEffect with effectSpeed
'fast'
end repeat
end demoEffect

See Also

locklevel .

vmouse of Actor
vMouse me
Returns a number that indicates the vertical position of the mouse pointer based on the
actor's coordinate system.
The coordinate system continues outside of the actor's boundaries, so even if the mouse
pointer is outside the actor, an appropriate value will be returned.
Note: The Actor must be contained by the Stage for vMouse to be valid. Otherwise an
error is signaled.◆

me (an Actor)

Page 101
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w i n d o w o f A c t o r

Example
get the vMouse of Actor

See Also

mouseloc .

window of Actor
window me
The window handler locates the actor's ultimate container actor –– the container that is
attached to Stage or to nothing. It may return itself.

me (an Actor)

zoom of Actor
zoom me, xfactor, yfactor
with preservecenter
The zoom handler adds hFactor to the actor's hScale and vFactor to the actor's vScale.
Then it redraws with the new scale. If preserveCenter is True , the center is preserved as
we zoom.
The default is True .

me (an Actor)
xfactor (a Number)
yfactor (a Number)
[with preservecenter] (a boolean)

See Also

setScale and setOrigin

ActorCollection
(a Collection)

One of two parents of Actor. This parent makes actors behave like any SK8 Collection . The
container and contents properties come from ActorCollection .

Page 102
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a p p l i c a t i o n n a m e o f A E Ta r g e t

See Also
Actor.

AETarget
(an Object)

An AETarget object represents the application program for use in directing AppleEvent objects.
The "new AETarget" form also takes an optional keyword argument to specify the target:
with signature <OstypeString>
An OstypeString (a four letter string) selects the program with that
signature running on the local machine.
with applicationName <String>
Finds an application program with that name running on the local
machine.
It is an error to specify both applicationName and signature keyword arguments.
If neither is specified, a dialog box pops up allowing the user to select from all of programs running on
all machines on the network.

Example
Examples:
new AETarget with signature "WILD"
new AETarget with applicationName "Hypercard"
["WILD" is the signature for Hypercard]

Properties of AETarget

applicationname of AETarget

Getter
get the applicationname of me

Returns the name of the application that the AETarget references as an OSTypeString, as a
string.

Page 103
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s i g n a t u r e o f A E Ta r g e t

me (an AETarget)

Setter
set the applicationname of me
to NewValue

Sets the AETarget to an application with the given name, a string, running on the local
machine.

me (an AETarget)
to

signature of AETarget

Getter
get the signature of me

Returns the signature of the application that the AETarget references as an OSTypeString,
a four character string.

me (an AETarget)

Setter
set the signature of me
to NewValue

Sets the AETarget to a new AppleEvent application with the given OSTypeString (a four
character string) running on the local machine.

me (an AETarget)
to

AnimatedClock
(an AnimatedCursor)

Page 104
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l a s t C u r s o r o f A n i m a t e d C u r s o r

The AnimatedCursor that represents the spinning clock. It can be used just like a normal cursor by
setting the cursor of the Stage to it.

See Also
set cursor of the Stage , with cursor and with lockedCursor.

AnimatedCursor
(a RealTimeClock)

A RealTimeClock that ticks 15 times per second. On each tick the cursor of the Stage is set to the
next cursor in the animatedCursor 's media property. The lastCursor property holds the index (in
the list of media ) of the cursor currently showing.
You can use animated cursors just like you use normal cursors: you set the cursor of the Stage to them.

See Also
set cursor of the Stage , with cursor and with lockedCursor.

Properties of AnimatedCursor

lastCursor of AnimatedCursor
Holds the index (in the list of media ) of the cursor currently showing. This property is set
automatically by the tick handler of this clock object. This will always be an integer from
1 to the length of the list in the animatedCursor's media .
Note: In the case of animatedCursors there is a distinction between the cursor of the
Stage and the cursor that is actually showing at the moment. The first one (stored in the
cursor property of the Stage) will be the animatedCursor. The second one, indicated by
the index in this property, is the cursor currently showing itself (a member of the
animatedCursor's media ).◆

Getter
get the lastCursor of me

me (an AnimatedCursor)

Page 105
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
M e d i a o f A n i m a t e d C u r s o r

Setter
set the lastcursor of me
to NewValue

me (an AnimatedCursor)
to (a CursorRSRC)

See Also

media and tick .

Media of AnimatedCursor
Stores the ordered list of cursors that will be cycled through when the animatedCursor
becomes the cursor of the Stage .

Getter
get the Media of me

me (an AnimatedCursor)

Setter
set the media of me
to NewValue

me (an AnimatedCursor)
to: A list of CursorRSRC objects.

Handlers of AnimatedCursor

stop of AnimatedCursor
stop me
Sets the cursor of the Stage to the StandardCursor.

me (an AnimatedCursor)

Page 106
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t i c k o f A n i m a t e d C u r s o r

See Also

set cursor of the Stage .

tick of AnimatedCursor
tick me
Changes the cursor of the Stage to the next cursor in the animatedCursor's media
property. The cursor currently shown is indicated by the index in the lastCursor
property. The next cursor is the one right after it. If the end of the list is found we wrap to
the start.

me (an AnimatedCursor)

See Also

cursor of the Stage , lastCursor.

AppleEvent
(an Object)

See _Inside Macintosh_ for information about AppleEvents and how they work.
SK8 has objects that can be used to implement AppleEvent send and receive operations.
An AppleEvent object has the following virtual properties:
Target An AETarget object.
an eventClass The catagory of command, an OstypeString.
an eventID The id of the command, an OstypeString.
For low-level implementation reasons, any AppleEvent object needs all these
so they are all required to be specified when the AppleEvent is created.
Example:
new AppleEvent¬
with target HyperCardTarget¬
with eventClass "misc"¬
with eventID "eval"
The eventClass and eventID together encode a command and are specific to the
application. So it's the responsibility of the application to document the

Page 107
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a e d e s c o f A p p l e E v e n t

eventClass, eventID, parameters and return values of every command.

Properties of AppleEvent

aedesc of AppleEvent
<private>

Getter
get the aeDesc of me

Setter
set the aedesc of me
to NewValue

AETarget of AppleEvent
The target application of this AppleEvent object, an AETarget object.

Getter
get the AETarget of me

Setter
set the aetarget of me
to NewValue

Sets the target application for the AppleEvent to the given AETarget object.

me (an AppleEvent)
to

reply of AppleEvent
<private>

Getter
get the reply of me

Page 108
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e v e n t c l a s s o f A p p l e E v e n t

Setter
set the reply of me
to NewValue

Handlers of AppleEvent

eventclass of AppleEvent
eventClass me
The EventClass of the AppleEvent, an OSTypeString (a four character string).

me (an AppleEvent)

eventid of AppleEvent
eventId me
The EventID of the AppleEvent, an OSTypeString (a four character String).

me (an AppleEvent)

extractparameter of AppleEvent
extractParameter me, key
with type
with errorifnotfound
with valueifnotfound
Extract the parameter from the AppleEvent object indexed by the given key, an
OSTypeString.
The keyword argument type can be used to specify a particular datatype. If supplied it
must also be an OSTypeString.
The keyword argument errorIfNotFound should be True to signal an error if the
parameter is not found, False otherwise. The default is to not signal an error.
The keyword argument valueIfNotFound supplies a value to be returned if the parameter
was not found. It defaults to False .

Page 109
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e x t r a c t r e p l y p a r a m e t e r o f A p p l e E v e n t

me (an AppleEvent)
key
[with type]
[with errorifnotfound]
[with valueifnotfound]

See Also

extractReplyParameter, insertParameter, insertReplyParameter

extractreplyparameter of AppleEvent
extractReplyParameter me, key
with type
with errorifnotfound
with valueifnotfound
Extract the parameter from the reply of the AppleEvent object, indexed by the given key,
an OSTypeString.
The keyword argument type can be used to specify a particular datatype. If supplied it
must also be an OSTypeString.
The keyword argument errorIfNotFound should be True to signal an error if the
parameter is not found, False otherwise. The default is to not signal an error.
The keyword argument valueIfNotFound supplies a value to be returned if the parameter
was not found. It defaults to False .

me (an AppleEvent)
key
[with type]
[with errorifnotfound]
[with valueifnotfound]

See Also

extractParameter, insertParameter, insertReplyParameter

insertparameter of AppleEvent
insertParameter me, key, value
with type
Inserts the value as a parameter into the AppleEvent indexed by key, an OSTypeString.
The keyword argument type can be used to specify a particular datatype. If supplied it
must also be an OSTypeString.

Page 110
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n s e r t r e p l y p a r a m e t e r o f A p p l e E v e n t

me (an AppleEvent)
key
value
[with type]

See Also

extractParameter, extractReplyParameter, insertReplyParameter

insertreplyparameter of AppleEvent
insertReplyParameter me, key, value
with type
Inserts the value as a parameter into the AppleEvent's reply, indexed by key, an
OSTypeString.
The keyword argument type can be used to specify a particular datatype. If supplied it
must also be an OSTypeString.

me (an AppleEvent)
key
value
[with type]

See Also

extractParameter, extractReplyParameter, insertParameter

send of AppleEvent
send me
with replymode
Send the AppleEvent to the application.
The optional keyword argument replyMode can have any of these symbol values:
'wait' Wait for a reply, return after reply is received.
'none' No reply expected, just return when the AppleEvent has been sent.
'queue' Queue up the reply, return when the AppleEvent has been sent.
The default is 'none'.

me (an AppleEvent)
[with replymode]

Page 111
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d e s c r i p t i o n o f A p p l e E v e n t E r r o r

AppleEventError
(a SystemError)

Error type describing an Apple Event system error


Note: Refer to Error Handling in the Sk8 Language Guide◆

Properties of AppleEventError

description of AppleEventError
<private>

Getter
get the description of me

Setter
set the description of me
to NewValue

AppleEventReceiver
(an Object)

For building AppleEvent applications, the receiving side of AppleEvent commands.


AppleEventReceivers are dispatch targets for AppleEvents. They contain two properties describing the
command:
eventClass an OSTypeString (a string four characters long)
eventID an OStypeString
Setting either of these updates the internal dispatch table.
To create an AppleEventReceiver, do this:
new AppleEventReceiver¬
with objectName "TestCommand"¬

Page 112
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e v e n t c l a s s o f A p p l e E v e n t R e c e i v e r

with eventClass "SK8C"¬


with eventID "test"
When an AppleEvent is received, it is dispatched to the appropriate HandleAppleEvent handler. To
implement an AppleEvent command you need to write a HandleAppleEvent handler on the appropriate
AppleEventReceiver.
The HandleAppleEvent handler's arguments are:
AppleEventReceiver the AppleEventReceiver
theAppleEvent received SK8 AppleEvent object

Properties of AppleEventReceiver

eventclass of AppleEventReceiver

Getter
get the eventClass of me

Setter
set the eventclass of me
to NewValue

me (an AppleEventReceiver)
to

eventid of AppleEventReceiver

Getter
get the eventId of me

Setter
set the eventid of me
to NewValue

me (an AppleEventReceiver)
to

Page 113
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
I n t e r p r e t R e s u l t o f A p p l e S c r i p t

AppleScript
(an Object)

The AppleScript object allows the user to run arbitrary AppleScripts from within SK8.

Example
new AppleScript with objectname "ASExample" with scripttext "beep"
execute ASExample

Properties of AppleScript

InterpretResult of AppleScript
Controls whether or not an attempt is made to convert the result returned when the
AppleScript is executed into a SK8 objects. If this property is false or the object cannot
be converted the result is an AppleScriptResult object. By default the value is true .
The following conversions are supported:
If the AppleScript returns the null value indicating no result, the object
EmptyAppleScriptResult is returns.

The AppleScript values True and False are converted to the SK8 values True and False .
All numeric AppleScript types are converted to appropriate SK8 values.
All forms of AppleScript text values are converted to SK8 String s.
AppleScript PICTs are converted to SK8 QDPicture s.
AppleScript aliases are converted to SK8 AliasFile s.
AppleScript lists are converted to SK8 List s and the members or the list are recursively
converted.
AppleScript records are converted to SK8 List s of keyword OSType /value pairs. The
values are recursively converted into SK8 objects.

Getter
get the interpretResult of me

me (a AppleScript)

Page 114
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
S c r i p t Te x t o f A p p l e S c r i p t

Setter
set the interpretresult of me
to NewValue

me (a AppleScript)
to (a boolean)

ScriptText of AppleScript
A string containing the text of the AppleScript to be run. The string must be syntactically
correct AppleScript in the English dialect or it will be unable to execute.

Getter
get the scriptText of me

me (a AppleScript)

Setter
set the scripttext of me
to NewValue

Sets the script to be run. Clears all internal references to any previously compiled script
so they can be garbage collected.

me (a AppleScript)
to (a String)

Example
local script
set script to "tell application \"Scriptable Text Editor\"" &
newline
insert "set selection to \"Hello world\"" & newline at end of
script
insert "end tell" at end of script
set ScriptText of ASExample to script

Page 115
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
E x e c u t e o f A p p l e S c r i p t

Handlers of AppleScript

Execute of AppleScript
execute me
Ensures that the ScriptText has been compiled and then executes the AppleScript. The
result of the AppleScript is returned.

me (a AppleScript)

Example
set ScriptText of ASExample to "beep"
execute ASExample

See Also

InterpretResult

Precompile of AppleScript
preCompile me
Passes the contents of the ScriptText property to the AppleScript compiler and stores
the result for later use. This will detect any syntax errors and will increase the speed of
the first call to the Execute handler. It is never necessary to call this handler and in
general it should only be called after the ScriptText has changed.

me (a AppleScript)

Example
The following will not beep, but a subsequent call to Execute will beep sooner than if it
had been called without first calling Precompile .
Note: If Execute is called first and the value of ScriptText does not change, then
Precompile will not save any time since Execute automatically compiles the script and
stores the result if it hasn't already been done.◆
set ScriptText of ASExample to "beep"
precompile ASExample

Page 116
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
D e s c Ty p e o f A p p l e S c r i p t R e s u l t

AppleScriptResult
(an Object)

Children of this object are returned as the result of calling execute on a child of AppleScript either
when the InterpretResult property of the child of AppleScript is False or the system does not
know how to translate the result into a regular SK8 object. An AppleScriptResult consists of an
OSType and a garbage-collectable Macintosh handle.

Example
The following script will return a child of AppleScriptResult:
new AppleScript with objectname "ASExample" with scripttext "return 4"
set InterpretResult of ASExample to False
execute ASExample

See Also
AppleScript

Handlers of AppleScriptResult

DescType of AppleScriptResult
descType me
Returns an OSType corresponding to the DescType of the value returned by the
AppleScript. See Inside Macintosh - Interapplication Communication chapter 10.

me (a AppleScriptResult)

Example
new AppleScript with objectname "ASExample" with ScriptText "Beep"
set InterpretResult of ASExample to False
DescType of Execute ASExample

ExtractHandle of AppleScriptResult
extractHandle me
Returns an garbage collectable Macintosh handle containing the information returned by
the AppleScript that created this object.

Page 117
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a r g u m e n t n a m e o f A r g u m e n t Ty p e M i s m a t c h E r r o r

me (a AppleScriptResult)

Example
new AppleScript with objectname "ASExample" with ScriptText "return
5"
set InterpretResult of ASExample to False
ExtractHandle of Execute ASExample

AppleTalkError
(a SystemError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

ArgumentTypeMismatchError
(a TypeMismatchError)

Properties of ArgumentTypeMismatchError

argumentname of ArgumentTypeMismatchError

Getter
get the argumentName of me

Setter
set the argumentname of me
to NewValue

Page 118
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h a n d l e r n a m e o f
A r g u m e n t Ty p e M i s m a t c h E r r o r

handlername of ArgumentTypeMismatchError

Getter
get the handlerName of me

Setter
set the handlername of me
to NewValue

Handlers of ArgumentTypeMismatchError

writeobject of ArgumentTypeMismatchError
writeObject me, thestream, rereadably

me (an ArgumentTypeMismatchError)
thestream
rereadably

ArithmeticError
(an Error)

The parent object of Arithmetic error warnings.

See Also
The Condition System section of the User Guide's SK8Script Language chapter

Page 119
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o p e r a n d s o f A r i t h m e t i c E r r o r

Properties of ArithmeticError

operands of ArithmeticError

Getter
get the operands of me

Setter
set the operands of me
to NewValue

operation of ArithmeticError

Getter
get the operation of me

Setter
set the operation of me
to NewValue

ArithmeticOverflowError
(an ArithmeticError)

One of two possible arithmetic errors.

See Also
The Condition System section of the User Guide's SK8Script Language chapter

Page 120
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w r i t e o b j e c t o f A r i t h m e t i c O v e r fl o w E r r o r

Handlers of ArithmeticOverflowError

writeobject of ArithmeticOverflowError
writeObject me, thestream, rereadably

me (an ArithmeticOverflowError)
thestream
rereadably

Arrow
(a LineSegment)

The Arrow is a child of LineSegment that knows how to draw arrow heads at its endpoints . You
manipulate the Arrow just like you would a LineSegment. Extra properties are provided to specify
whether arrows are present and what the arrow size should be.

See Also
arrows and arrowsize .

Properties of Arrow

arrows of Arrow
Specifies whether the arrow will draw an arrow head at its startPoint , its endPoint or
both enpoints .

Getter
get the arrows of me

Returns 'both' , 'start' or 'end' to indicate where the arrows are drawn.

Page 121
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a r r o w s i z e o f A r r o w

me (a Arrow)

Setter
set the arrows of me
to NewValue

me (a Arrow)
to: One of 'both' , 'start' , 'end' .

arrowsize of Arrow
Specifies the size of all arrowheads this arrow draws. The size is specified as a list of two
numbers: the width and the height. This argument actually determines the size of an
imaginary rectangle into which the arrow heads are inscribed.

Getter
get the arrowSize of me

me (a Arrow)

Setter
set the arrowsize of me
with physical
with relative
to NewValue

me (a Arrow)
[with physical]: If True , the coordinates are assumed to be given in physical
(Stage ) coordinates.
[with relative]: If True , the coordinates are assumed to be offsets from the
current values.
to: A list of two numbers.

endarrow of Arrow
Specifies whether the arrow draws an arrow head at its endPoint .
Note: This is a virtual property derived from the arrows property of arrow.◆

Getter
get the endArrow of me

Page 122
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s t a r t a r r o w o f A r r o w

Returns True if the arrow's arrows property returns 'end' or 'both' .

me (a Arrow)

Setter
set the endarrow of me
to NewValue

Specifies whether this arrow has an arrowhead at its endPoint .

Note: it is an error to leave the arrow without any arrow heads. Thus, you cannot set the
endArrow to False when the arrow's arrows equals 'end' .◆

me (a Arrow)
to (a boolean)

See Also

startPoint , arrows .

startarrow of Arrow
Specifies whether the arrow draws an arrow head at its startPoint .
Note: This is a virtual property derived from the arrows property of arrow.◆

Getter
get the startArrow of me

Returns True if the arrow's arrows property returns 'start' or 'both' .

me (a Arrow)

Setter
set the startarrow of me
to NewValue

Specifies whether this arrow has an arrowhead at its startPoint .

Note: it is an error to leave the arrow without any arrow heads. Thus, you cannot set the
startArrow to False when the arrow's arrows equals 'start' .◆

Page 123
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b o t t o m r e n d e r e r o f B e v e l R e n d e r e r

me (a Arrow)
to (a boolean)

See Also

startPoint , arrows .

BevelRenderer
(a Renderer)

The BevelRenderer is designed to create a bevel effect using the frame of a rectangle.
It is particularly suited as a frameColor renderer. The net effect is to bevel the frame area of an actor,
giving it a 3D appearance. The prototype BevelRenderer renders a grayish area. You may change the
renderer used to color to bottom, left, right and top parts of the actor's area by setting the
bottomRenderer, leftRenderer, rightRenderer and topRenderer properties, respectively, to the
renderer you wish.
Note: Bevel renderers are used to add "3-dimensional" shadowing around the sub-panels in Sk8
windows. To see the effect, set the framecolor property of a rectanglular actor to a bevel renderer, and the
framesize (the width of the frame) to {1,1} or {2,2} or even larger.◆

See Also
bottomRenderer, leftRenderer, rightRenderer and topRenderer.

Properties of BevelRenderer

bottomrenderer of BevelRenderer
Specifies the renderer used for the bottom side.

Getter
get the bottomRenderer of me

me (a BevelRenderer)

Page 124
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
f r a m e r e l a t i v e o f B e v e l R e n d e r e r

Setter
set the bottomrenderer of me
to NewValue

me (a BevelRenderer)
to (a Renderer)

framerelative of BevelRenderer
This property specifies whether or not the bevel is constructed relative to the frame of the
actor or to the fill. This property defaults to True as most of the time bevelrenderers are
used as a framecolor.

Getter
get the frameRelative of me

me (a BevelRenderer)

Setter
set the framerelative of me
to NewValue

me (a BevelRenderer)
to (a boolean)

leftrenderer of BevelRenderer
This should contain the renderer in which you wish to color the left part of the area being
rendered.

Getter
get the leftRenderer of me

me (a BevelRenderer)

Setter
set the leftrenderer of me
to NewValue

Page 125
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r i g h t r e n d e r e r o f B e v e l R e n d e r e r

me (a BevelRenderer)
to (a Renderer)

rightrenderer of BevelRenderer
This should contain the renderer in which you wish to color the right part of the area
being rendered.

Getter
get the rightRenderer of me

me (a BevelRenderer)

Setter
set the rightrenderer of me
to NewValue

me (a BevelRenderer)
to (a Renderer)

toprenderer of BevelRenderer
This should contain the renderer in which you wish to color the top part of the area being
rendered.

Getter
get the topRenderer of me

me (a BevelRenderer)

Setter
set the toprenderer of me
to NewValue

me (a BevelRenderer)
to (a Renderer)

Page 126
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e n d e r o f B e v e l R e n d e r e r

Handlers of BevelRenderer

render of BevelRenderer
render me, theactor, region, thepaper
Contructs the four masks and renders each renderer into the appropriate one.

me (a BevelRenderer)
theactor (an Actor): The Actor being rendered.
region (a Mask): The region to be rendered.
thePaper: The surface on which the drawing takes place. This argument
should be passed "as is" to other render handlers and some handlers
defined on the Pen and Mask objects.

Translucent of BevelRenderer
Translucent me
Returns True if any of the four renderers used is translucent .

me (a BevelRenderer)

BigFloat
(a Float)

This object is the parent of all standard-representation (IEEE double) floating point numbers. The
representation supports floats in the range from -1.7976931348623157e+308 to 1.7976931348623157e+308.
Note: Floating point numbers, by default, are represented as BigFloat , but those within the
representation limits of SmallFloat can be coerced to its more compact representation (either at
runtime —e.g. 1.5 as a SmallFloat — or at compile time —e.g. the SmallFloat 1.5 ).◆

See Also
SmallFloat

Page 127
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n v o k a b l e o f B r i n g U p H a n d l e r

BigInteger
(an Integer)

This object is the parent of all extended-representation integers. This representation supports all integers
outside the range from -268435456 to 268435455, limited only by available memory.
Note: The choice between SmallInteger and BigInteger for integer representation is handled
automatically by the system based on the magnitude of the integer; you cannot coerce a SmallInteger
to a BigInteger, or vice versa.◆

See Also
SmallInteger

BringUpHandler
(a ConditionResponse)

Invoking this response brings up a handler editor for the current handler, indicating therein the location
and nature of the current condition.
The response is invokable if the system can find the source script for the current handler.

See Also
editHandlerObject , ConditionResponse , the Condition System section of the User Guide's
SK8Script Language chapter

Handlers of BringUpHandler

invokable of BringUpHandler
invokable me
Returns True if the system can find the source script for the current handler.

me (a BringUpHandler)

Page 128
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n v o k e o f B r i n g U p H a n d l e r

See Also

ConditionResponse

invoke of BringUpHandler
invoke me
Brings up a handler editor for the current handler, indicating therein the location and
nature of the current condition.

me (a BringUpHandler)

See Also

editHandlerObject , ConditionResponse

writeObject of BringUpHandler
writeObject me, thestream, rereadably
If rereadably is True , this just does the inherited writeObject behavior.
Otherwise, if the response is invokable, it writes a description of what the
BringUpHandler response will do when invoked. If the response is not invokable, it
writes an explanation of why it is not.

me (a BringUpHandler)
theStream
rereadably

See Also

ConditionResponse , writeObject of Object

BrowserComponent
(an Object)

The BrowserComponent object is an encapsulation of the functionality of all of the browsing


components. This object is designed to be added as a parent to other objects in order to provide the
standard browsing component functionality. There are two main pieces of functionality. First, it will
cause an actor to highlight itself when it is the keytarget of a piece of browserpaper. Second, it will
define a MenuPrototype handler on the object (described in detail in browserMenuBar ).

Page 129
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t a r g e t p r o j e c t o f B r o w s e r C o m p o n e n t

The following conventions are used in all the existing browser components. Please follow these
conventions when making your own components. First, the standard API to a component is defined by
it's properties. There are one or more "input" properties which define the set of constructs that the
component operates on. For example, the PropertyPicker has a property 'inputobjects' takes a list of
objects and displays their shared properties. In general, all components which deal with objects should
deal with single or multiple object input allowing multiple object editing.
Components generally have one or more output properties which will output the viewed information or
some subset of the viewed information (say the selected item(s)). For example, the PropertyPicker
has a property 'outputproperty'. This is the currently selected property. Note that the property list also
has a property 'outputObjects' which always outputs the current 'inputObjects'. The reason for this is
that it is a good idea to have each component output all the information another cooperating component
would need to work with it. For example, a property list is generally wired to some kind of property
value editor. Such an editor needs to know both the property name as well as the set of objects in which
this property is being edited.
Another convention followed in Browser Components generally is the editing property. This property
can be set to True or False , and acts like a safety mechanism. When it is set to False , it should shut
off the editing capabilities of the component. That means that no changes should be made to the
constructs being viewed.
Another good thing to do when building components is to try to point to the minimum set of objects, and
to let go of objects as soon as possible. This is so that your browser does not hold on to a user's objects
that should be getting garbage collected.

See Also
See the functions: BrowserHighlight() and BrowserUnhighlight()

Properties of BrowserComponent

targetproject of BrowserComponent
This property tells the BrowserComponent which project to focus on. In particular, if
the user types in a SK8Script command or expression into a component (e.g. a
QueryField ) then that script is evaluated in the workspace specified by the targetProject.

Getter
get the targetProject of me

Setter
set the targetproject of me
to NewValue

Page 130
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a c t i v a t e t e x t o f B r o w s e r C o m p o n e n t

Handlers of BrowserComponent

activatetext of BrowserComponent
activateText me
Do the inherited activation, then if the component is in a piece of browserPaper,
surround the component with a halo .

me (a BrowserComponent)

See Also

DeactivateText

deactivatetext of BrowserComponent
deactivateText me
Do the inherited deactivation, then if the component is in a piece of browserPaper,
unsurround the component with a halo .

me (a BrowserComponent)

See Also

ActivateText

menuprototype of BrowserComponent
menuPrototype me
This handler should return the browser menus that are to be associated with this object.
See BrowserMenuBar for more details Note that MenuPrototype must return False , a
Menu, or a list of Menus.

me (a BrowserComponent)

resized of BrowserComponent
resized me

Page 131
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e t u p o f B r o w s e r M e n u B a r

This makes sure that if the component is resized and it is highlighted with a halo, that
halo is resized as well.

me (a BrowserComponent)

See Also

BrowserPaper

BrowserMenuBar
(a MenuBar)

This is a menubar with one additional handler called SetUp . When SetUp is called on this object, it
finds all the BrowserComponents in its container and gets their MenuPrototype . It then creates these
menus. Note that MenuPrototype is a handler defined on BrowserComponent that can return False ,
a Menu , or a list of Menus .
Note that menus specified by the MenuPrototype are assumed to have a property BrowserComponent
This property is set by setup to point to its corresponding component. This can be used, for example, in
an Update handler to set one of it's menuitem's text based on the component's current input or current
selection.

Example
EXAMPLE: The menubar at the top of the System Browser. These menus were created dynamically by
calling SetUp after the system browser's components were laid out.

Handlers of BrowserMenuBar

setup of BrowserMenuBar
setUp me
This handler is described in detail in the description of BrowserMenuBar.

me (a BrowserMenuBar)

Page 132
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h i g h l i g h t e r h a l o o f B r o w s e r P a p e r

BrowserPaper
(a Rectangle, BrowserComponent)

This object provides a way of encapsulating the a set of browsing/editing functionality, usually in a
window. It is a rectangle with a windowstyle of 'documentwithzoom '. Thus it has a titlebar when it
is on the Stage .
Each browserpaper has a halo (tagged as the HighlighterHalo ). This halo surrounds it's keytarget
when its a window.

See Also
Halo

Properties of BrowserPaper

highlighterhalo of BrowserPaper
Each browserpaper has a halo (tagged as the HighlighterHalo ) in it's contents. This
halo surrounds the browserPaper 's keytarget when it's a window.

Getter
get the highlighterHalo of me

Setter
set the highlighterhalo of me
to NewValue

BWPattern
(a Media)

Parent object of black and white pattern resources. They can be displayed by making them the media of
an imageRenderer.

See Also
ImageRenderer.

Page 133
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b o u n d s r e c t o f B W P a t t e r n

Handlers of BWPattern

boundsrect of BWPattern
boundsRect me
Returns the physical rectangle that encloses the image stored in this media object.

me (a BWPattern)

defaultrenderstyle of BWPattern
defaultRenderStyle me
Returns the way in which a media of this type is commonly rendered. For the BWPattern,
this handler returns 'renderTiled' .

me (a BWPattern)

displaysample of BWPattern
displaysample me, theactor
Calls showMediaInActor to display the BWPattern in the actor.

me (a BWPattern)
theActor (an Actor)

See Also

the function showMediaInActor.

renderstretched of BWPattern
renderStretched me, therenderer, theactor, region, thepaper
Renders the image in the BWPattern stretching it to fill the region to be rendered.

Page 134
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e n d e r t i l e d o f B W P a t t e r n

me (a BWPattern)
therenderer (an ImageRenderer): The renderer whose media is this
BWPattern.
theactor (an Actor): The actor currently being drawn.
region (a Mask): The region to be painted.
thePaper: The surface on which the drawing takes place. This argument
should be passed "as is" to other render handlers and some handlers
defined on the Pen and Mask objects.

rendertiled of BWPattern
renderTiled me, therenderer, theactor, region, thepaper
Renders the image stored in the BWPattern tiling it to fill the region to be painted.

me (a BWPattern)
therenderer (an ImageRenderer): The renderer whose media is this
BWPattern.
theactor (an Actor): The actor currently being drawn.
region (a Mask): The region to be painted.
thePaper: The surface on which the drawing takes place. This argument
should be passed "as is" to other render handlers and some handlers
defined on the Pen and Mask objects.

renderunstretched of BWPattern
renderUnstretched me, therenderer, theactor, region, thepaper
Renders the image stored in the BWPattern once, placing its topleft corner at the topleft of
the region to be rendered (or offset by the values in the hOffset and vOffset property
of the renderer).

size of BWPattern
size me
Returns the size in pixels of the image stored by this media object.

me (a BWPattern)

Page 135
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e l e m e n t t y p e o f B y t e S t r e a m

ByteStream
(a Stream)

ByteStreams are Streams for reading and writing binary data to files.
You can access binary files through path expressions which contain the selector byte.

Example
To create a file which contains the ASCII character set in ascending order:
repeat with i from 0 to 255
set byte i of MyByteStream to the character of i
end repeat

See Also
TextStream

Handlers of ByteStream

elementtype of ByteStream
elementType me
The elementType of a ByteStream is alwasys an UnsignedByte.

me (a ByteStream)

CantChangeConstantError
(a ProgrammaticError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

Page 136
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o n s t a n t n a m e o f C a n t C h a n g e C o n s t a n t E r r o r

Properties of CantChangeConstantError

constantname of CantChangeConstantError

Getter
get the constantName of me

Setter
set the constantname of me
to NewValue

Handlers of CantChangeConstantError

writeobject of CantChangeConstantError
writeObject me, thestream, rereadably

me (a CantChangeConstantError)
thestream
rereadably

Character
(an Object)

This object is the parent of all characters. This representation supports standard ASCII characters (ASCII
codes 0 through 255).
There is no special literal form for a character, but the “general object literal” form may be used to create
character literals based on integers or strings. For example
get whether Space = the Character 32 --> returns True
get whether Quote = the Character "\"" --> returns True

Page 137
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i s l o w e r c a s e o f C h a r a c t e r

Note: Character also has the three properties forwardMapper, forwardMapperForMods and
reverseMapper in order to support the TextChunk protocol.◆

See Also
Char, Space , Newline , Tab , Enter, Delete , LeftArrow, RightArrow, UpArrow, DownArrow,
Escape , Quote , Word , Line , Paragraph

Handlers of Character

islowercase of Character
islowercase me
Returns True if the character is a lower case character.

me (a Character)

See Also

isUpperCase .

isuppercase of Character
isuppercase me
Returns True if the character is an upper case character.

me (a Character)

See Also

isLowerCase .

CheckBox
(a Label)

Page 138
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c h e c k c o l o r o f C h e c k B o x

The CheckBox is an object used to represent a binary choice. For example, whether background printing
is on or not. The CheckBox is checked when the option is True (an “X” is rendered into a square inside
it) and unchecked when the option is False .
A CheckBox is a Label whose text is offseted to the right a sufficient number of pixels to leave space for
the CheckBoxCheck : a rectangle with an “X” rendered inside. The CheckBox's mouseSensitivity is
'opaque' , thus clicking anywhere on it checks or unchecks it.

Note: The CheckBox assumes that the first item in its contents is a CheckBoxCheck .◆

See Also
check , checked .

Properties of CheckBox

checkcolor of CheckBox
Determines the color of the check that appears in a checked check box. The default value
for this setting is Red , which will cause a red “X” to appear in the checkBox. The
checkColor property can only be set to descendants of RGBColor.

Getter
get the checkColor of me

me (a CheckBox)

Setter
set the checkcolor of me
to NewValue

me (a CheckBox)
to

checked of CheckBox
Returns True when the checkBox is checked. When it is, an “X” is drawn into a square
inside the checkBox.

Getter
get the checked of me

Page 139
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c h e c k s i z e o f C h e c k B o x

me (a CheckBox)

Setter
set the checked of me
to NewValue

Checks or unchecks the checkBox. Forces the checkbox to redraw to show the changes.

me (a CheckBox)
to (a boolean)

See Also

check which can be use to toggle this property.

checksize of CheckBox
An integer specifying the width (in pixels) of the lines that compose the "X" in the
checkbox.

Getter
get the checkSize of me

me (a CheckBox)

Setter
set the checksize of me
to NewValue

me (a CheckBox)
to (an Integer)

highlight of CheckBox
The CheckBox only redefines the set highlight handler. For a description of this
property in general see the highlight property of Actor.

Setter
set the highlight of me
to NewValue

Page 140
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a c t o r t e x t s i z e o f C h e c k B o x

This handler is redefined to set the frameSize of the checkBoxCheck to {2,2} when this
property is set to True and to {1,1} when it is set to False .

me (a CheckBox)
to (a boolean)

See Also

highlight of Actor.

Handlers of CheckBox

actortextsize of CheckBox
actorTextSize me
with thetext
Given a checkbox, returns the size of the boundsrect required to fit its text, or the text
provided by theText.

me (a CheckBox)
[with thetext]: A string to be used. If not provided, the checkBox's text is
used.

check of CheckBox
check me
Calling the check handler is equivalent to clicking on the checkBox. If it is checked , it
unchecks it. Otherwise, it checks it.

me (a CheckBox)

Example
Here is how this handler is defined:
on check of me (a CheckBox)
set my checked to not(my checked)
end check

Page 141
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o u s e u p o f C h e c k B o x

See Also

set checked .

mouseup of CheckBox
mouseUp me
Calls the check handler to change the checked status of the checkBox.

me (a CheckBox)

See Also

check and checked .

resized of CheckBox
resized me
Resizes its contents when the CheckBox changes size .

me (a CheckBox)

ChooseResponse
(a ConditionResponse)

Invoking this response brings up a dialog from which one of the currently invokable responses can be
chosen.
It is invokable if the global variable InteractiveErrors has a non-False value (its default value is
False ) and there are other condition responses currently invokable (as given by the function
currentInvokableConditionResponses ).

See Also
InteractiveErrors , currentInvokableConditionResponses , ConditionResponse , the
Condition System section of the User Guide's SK8Script Language chapter

Page 142
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n v o k a b l e o f C h o o s e R e s p o n s e

Handlers of ChooseResponse

invokable of ChooseResponse
invokable me
Returns True if the global variable InteractiveErrors has a non-False value and
there are other condition responses currently invokable (as given by the function
currentInvokableConditionResponses ).

me (a ChooseResponse)

See Also

InteractiveErrors , currentInvokableConditionResponses ,
ConditionResponse

invoke of ChooseResponse
invoke me
Brings up a dialog from which one of the currently invokable responses can be chosen.

me (a ChooseResponse)

See Also

currentInvokableConditionResponses , ConditionResponse

clipBoard
(an Object)

In general, the Clipboard is an object that acts as an interface between and inner and an outer world for
the purpose of exchanging data. The clipboard can also be used as a temporary repository of objects.
Objects usually get into the clipboard as a result of a copySelectionToClipboard or a
pasteClipboardToSelection operation. The clipboard can hold multiple objects of different types.
The handlers addToClipboard and getFromClipboard are used to add or remove things from the
clipboard.

Page 143
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c l i p b o a r d o p e n o f C l i p B o a r d

The SK8Clipboard (the only child of Clipboard ) is used by the system for all cut/paste style
operations. Its suspend and resume handler perform the whole exchange between SK8 and the outside
world.

See Also
The Translator and SK8Clipboard objects.

Properties of clipBoard

clipboardopen of ClipBoard
Whether the clipboard is open to activity outside SK8. If this property is False , no
importing and exporting activity is automatically triggered by the clipboard. This defaults
to True .

Getter
get the clipBoardOpen of me

me (a clipBoard)

Setter
set the clipboardopen of me
to NewValue

me (a clipBoard)
to (a boolean)

incomingdata of ClipBoard
This property is True when the contents of the clipboard were overwritten by external
data (data coming from outside of SK8). This property is set by the system when SK8
resumes by checking the value in the scrapCount property.

Getter
get the incomingData of me

me (a clipBoard)

Page 144
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o b j e c t s o n h o l d o f C l i p B o a r d

Setter
set the incomingdata of me
to NewValue

You should not set this property yourself since the system does it automatically when the
it resumes.

me (a clipBoard)
to (a boolean)

See Also

scrapCount .

objectsonhold of ClipBoard
This property holds all the objects in the clipboard. Note that you should not look inside
the clipboard in this way. The objectsInClipboard handler should be used to see
what is available.

Getter
get the objectsOnHold of me

me (a clipBoard)

Setter
set the objectsonhold of me
to NewValue

You should not set this property by hand. The addToClipboard handler should be used.

me (a clipBoard)
to

See Also

objectsInClipboard and addToClipboard .

scrapcount of ClipBoard
The scrapCount property is updated on restore to keep a global count of the number of
copy/paste operations that have been done in your computer since start up. If the

Page 145
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c l e a r c l i p b o a r d o f C l i p B o a r d

scrapCount is less than the current scrap count when SK8 resumes, the incomingData
property is set to True to indicate that there is something from the outer world in the
clipboard.

Getter
get the scrapCount of me

me (a clipBoard)

Setter
set the scrapcount of me
to NewValue

This property is set automatically by the system on resume.

me (a clipBoard)
to (an Integer)

See Also

incomingData .

Handlers of clipBoard

clearclipboard of ClipBoard
clearClipBoard me
Clears the clipboard. This will be called just before the clipboard is overwritten by
something else. All the items in it are let go. If there are no other references to them they
will get garbage collected.

me (a clipBoard)

getfromclipboard of ClipBoard
getFromClipBoard me, thing, inproject
with copy
with removal
with everyone

Page 146
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o b j e c t s i n c l i p b o a r d o f C l i p B o a r d

This is THE handler used to get things out of the clipboard. The two required arguments
specify the type of thing we want to get out of the clipboard and the project into which to
bring new things (since many times the clipboard will return new instances of objects).
This handler is very versatile allowing you to do a variety of things to the objects in the
clipboard.

me (a clipBoard)
thing: A SK8 object specifying the type of object we want to get from the
clipboard.
inproject (a Project): This is the object into which objects will be created as
the result of paste operations.
[with copy]: If True , the handler returns copies of the items found in the
clipboard. Otherwise, the actual items in the clipboard are returned. If a
copy needs to be made, it is made in the project specified. Defaults to
True .
[with removal]: If True , objects found in the clipboard are removed from it
before the handler returns. Defaults to False .
[with everyone]: If True , this handler will return everything in the
clipboard that inherits from the specified type. Otherwise it will return
the first item it finds. Defaults to False .

objectsinclipboard of ClipBoard
objectsInClipBoard me
What this handler returns depends on the value of the incomingData property. If
incomingData is False , the objectsOnHold is returned.
Otherwise it means that something went into the system's scrap before we returned to
SK8 from outside. When this happens, the clipboard looks at the scrap to see what objects
are available. What this handler will then return is a list of the objects that could
potentially be created from what is available on the scrap. This list is computed by asking
the clipboard for the importTranslatorsApplicable and listing the finalObject
of each one.

me (a clipBoard)

See Also

objectsInClipboard for an extensive example illustrating this subtlety. Also see


importTranslatorsApplicable and finalObject of Translator.

typesinclipboard of ClipBoard
typesInClipBoard me

Page 147
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t y p e s i n c l i p b o a r d o f C l i p B o a r d

Returns the baseParent of every item in the clipboard.


Note: if the incomingData of the clipboard is True , it returns the baseParent of every
item we could potentially make out of what is available on the scrap.◆

me (a clipBoard)

Example
Let us explain the note above with a simple example. Consider a state of SK8 in which the
objectsOnHold of the SK8Clipboard contains Julio (a Rectangle) and ZoomUpSound (a
Sound). First of all, notice that in this case the objectsOnHold and the objectsInClipboard
return the same thing:
get the objectsOnHold of the SK8Clipboard
{Julio, ZoomUpSound}
get the objectsInClipboard of the SK8Clipboard
{Julio, ZoomUpSound}
Now notice what typesInClipboard returns.
get the typesInClipboard of the SK8Clipboard
{Rectangle, Sound}
Now suppose we leave SK8 and paste a "PICT" into the clipboard. As we return to SK8,
we notice the following:
get the incomingData of the SK8Clipboard
True
So, lets ask for the typesInClipboard and the objectsInClipboard.
get the typesInClipboard of the SK8Clipboard
{ImageRenderer, QDPicture}
This is the baseParent of things we could make using all import translators available.
Now, the objectsInClipboard and the objectsOnHold.
get the objectsInClipboard of the SK8Clipboard
{QDPicture}
get the objectsOnHold of the SK8Clipboard
False
You should notice that the clipboard has been cleared although objectsInClipboard says
there is something there.

See Also

objectsInClipboard , objectsOnHold , incomingData and clearClipboard .

Page 148
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c u r r e n t Ti m e o f C l o c k

Clock
(an AbstractClock)

The child of AbstracClock that roots the hierarchy of clocks that SK8 offers. All objects derived from
Clock have the following characteristics:

The master property and the slaves property. These properties implement the clock hierarchy. The
root of the hierarchy is the SystemClock which is ticked as fast as the system can allow. In order to be
ticking, a clock has to be in the clock hierarchy which means that if we followed the master relation
upwards we would hit the SystemClock .
Clocks define a local time that is started at the startTime and ends at the endTime . Each time the clock
ticks its currentTime is incremented by the timePerTick .
By setting the masterOffset property we can specify at which time value in the master 's local time
frame we want this slave to start running.
Start and stop can be used to start and stop the clock. It is important to note that a clock without a
master will never tick .

See Also
master, slaves , tick , running , start , stop .

Properties of Clock

currentTime of Clock
This property specifies the current time of the clock in its local time frame. It is usually set
automatically by the tick handler.

Getter
get the currentTime of me

me (a Clock)

Setter
set the currenttime of me
to NewValue

Page 149
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e n d Ti m e o f C l o c k

me (a Clock)
newValue (a Number): The current time of the clock in its local time frame.

See Also

timePerTick , startTime and endTime .

endTime of Clock
Specifies the end of the clock's local time frame. When this value is reached, the clock
stops ticking.

Getter
get the endTime of me

me (a Clock)

Setter
set the endtime of me
to NewValue

me (a Clock)
newValue: The end of the clock's local time frame as a Number or False to
indicate that this clock should never stop running.

See Also

startTime , running .

master of Clock
Specifies the clock that is one level up from this clock in the clock hierarchy. Whenever the
master ticks it checks whether the required conditions are satisfied to start (or stop )
this clock.

Getter
get the master of me

me (a Clock)

Page 150
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a s t e r O f f s e t o f C l o c k

Setter
set the master of me
to NewValue

me (a Clock)
to: A clock or False .

See Also

slaves .

masterOffset of Clock
Specifies the time in the local time frame of the clock's master at which the clock should
start ticking. At that point its currentTime is set to its startTime and from then on
gets incremented by the timePerTick until the endTime is reached at which point the
clock stops ticking.

Getter
get the masterOffset of me

me (a Clock)

Setter
set the masteroffset of me
to NewValue

me (a Clock)
to (a Number)

running of Clock
Specifies whether this clock has been started but has not been stoped (it is running).

Getter
get the running of me

me (a Clock)

Page 151
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s l a v e s o f C l o c k

Setter
set the running of me
to NewValue

Starts the clock running. All this means is that all the masters of this clock will be started
which does not guarantee that the clock itself will start ticking. The clock will only start
ticking when its master 's currentTime is greater than the clock's masterOffset .
Then again, its master will not start ticking until the same condition is fulfilled with its
master. Finally, your clock will not tick unless its final master is the SystemClock .

me (a Clock)
to (a boolean)

See Also

start , stop which are shorthands for the set running handler.

slaves of Clock
This property stores a list of clocks that depend on this clock for being ticked. Each time
the clock ticks it checks whether its slaves should be ticking and if so, sends them the
tick message.

Getter
get the slaves of me

me (a Clock)

Setter
set the slaves of me
to NewValue

Only set this property by setting the master property of the slave in question. Set master
does all the required set up.

me (a Clock)
to: A list of clocks or False .

See Also

master.

Page 152
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s t a r t Ti m e o f C l o c k

startTime of Clock
Specifies the value that the currentTime should be set to when the clock starts running.

Getter
get the startTime of me

me (a Clock)

Setter
set the starttime of me
to NewValue

me (a Clock)
newValue (a Number): The start of the clock's local time frame.

See Also

endTime , running .

ticking of Clock
This property specifies whether the clock is currently in its ticking phase: it has been
started and all the conditions required for ticking are fulfilled. This property should not be
set directly.

Getter
get the ticking of me

me (a Clock)

Setter
set the ticking of me
to NewValue

me (a Clock)
to (a boolean)

Page 153
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t i m e P e r Ti c k o f C l o c k

timePerTick of Clock
Specifies the amount to use to increment the currentTime of the clock's local time frame
every time the clock ticks.

Getter
get the timePerTick of me

me (a Clock)

Setter
set the timepertick of me
to NewValue

me (a Clock)
newValue (a Number): The amount to increment the currentTime
whenever a tick occurs.

See Also

currentTime .

Handlers of Clock

start of Clock
start me
Sets the running property to True . A clock may be running but not ticking (e.g. if the
currentTime of the master is less than the masterOffset of the clock). The clock will
begin running at its present currentTime . Starting a clock will automatically start its
master as well.

me (a Clock)

See Also

running .

Page 154
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s t o p o f C l o c k

stop of Clock
stop me
Sets the running property to False , stopping the clock from ticking.

me (a Clock)

See Also

running .

tick of Clock
tick me
This handler gets called at the time interval specified by the clock. This is where you get
control and can do the thing your clock was built for. The default handler ticks the clock's
slaves . You should do inherited when you have slaves .

me (a Clock)

See Also

slaves .

ClockError
(a SystemError)

Note: Refer to Error Handling in the Sk8 Language Guide◆

CoercionError
(a ProgrammaticError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

Page 155
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
O b j e c t o f C o e r c i o n E r r o r

Properties of CoercionError

Object of CoercionError
The object the BehaviorTrack is attached to.
Set object is a synonym for attach.
Editor's Note: Dont think this is correct, but only object I could find.
Documentation has this under BehaviorTrack Properties.

Getter
get the Object of me

Setter
set the object of me
to NewValue

Example
get the object of BehaviorTrack
set the object of BehaviorTrack to object

type of CoercionError

Getter
get the type of me

Setter
set the type of me
to NewValue

Page 156
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w r i t e o b j e c t o f C o e r c i o n E r r o r

Handlers of CoercionError

writeobject of CoercionError
writeObject me, thestream, rereadably

me (a CoercionError)
thestream
rereadably

Collection
(an Object)

Properties of Collection

currentItem of Collection

Getter
get the currentItem of me state

This handler returns the item of the collection “currently indicated” by the given state
value.

Note: An object intending to support the Collection Protocol must implement this
handler.◆

me (a Collection)
state

Setter
set the currentitem of mestatedependentStates
to NewValue

Page 157
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
n t h I t e m o f C o l l e c t i o n

This handler modifies the collection, replacing the item “currently indicated” by the given
state value with the given newItem.

Note: An object intending to support the Collection Protocol must implement this
handler.◆

me (a Collection)
state
[dependentStates]
to newItem

See Also

initialState (for a discussion of collection iteration states)

nthItem of Collection

Getter
get the nthItem of me n

Returns the item corresponding to the given index in the collection.

Note: An object intending to support the Collection Protocol need not implement this
handler, i.e. it may inherit it from Collection. It may, however, choose to implement it in
order to perform the operation more efficiently than the default implementation.◆

me (a Collection)
n

Setter
set the nthitem of mendependentStates
to NewValue

This handler modifies the collection, replacing the item corresponding to the given index
with the given newItem.

Note: An object intending to support the Collection Protocol need not implement this
handler, i.e. it may inherit it from Collection. It may, however, choose to implement it in
order to perform the operation more efficiently than the default implementation.◆

Page 158
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o l l e c t i o n L i k e o f C o l l e c t i o n

me (a Collection)
n
[dependentStates]
to newItem

See Also

initialState (for a discussion of collection iteration states)

Handlers of Collection

collectionLike of Collection
collectionLike me
This handler returns true if this collection “looks like” a collection, and false otherwise
(i.e. if it's primarily thought of as an atomic object).
The default collectionLike handler for collections returns True unless the collection
has an objectName , in which case it returns False .
Note: An example of how this is used in the system is Collection 's writeObject
handler: it describes a collectionLike collection in a list-like manner, listing each of
the items in the collection, whereas it describes a non-collectionLike collection using
the default object description.◆

me (a Collection)

collectionStructureShared of Collection
collectionStructureShared me, supercollection
Returns True if any destructive modification on this collection could cause a change in
the structure of superCollection (which should only be the case if this collection actually
represents a subset of the structure of superCollection).
Note: An object intending to support the Collection Protocol must implement this
handler.◆

me (a Collection)
superCollection

Page 159
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o n t a i n s S u b c o l l e c t i o n o f C o l l e c t i o n

Example
set super to "hello world"
collectionStructureShared("world", super)-- returns False
collectionStructureShared(word 2 of super, super)-- returns True

containsSubcollection of Collection
containsSubcollection me, subcollection, fromState, toState
with test
with exactmatch
Note: An object intending to support the Collection Protocol need not implement this
handler, i.e. it may inherit it from Collection. It may, however, choose to implement it in
order to perform the operation more efficiently than the default implementation.◆

me (a Collection)
subCollection (a Collection)
fromState: The state of the start of the subrange where the containment is
tested; if False , the subrange begins with the first item of me.
toState: The state following the end of the subrange where the containment
is tested; if False , the subrange ends with the last item of me.
[with test] (a Function or a Symbol): Test to be used for item comparison;
defaults to '=' .
[with exactMatch] (a boolean): If a specific test is not supplied, this value is
used for the exactMatch argument when calling = .

copyState of Collection
copyState me, state, intostate
Returns a state which is equivalent to the given state for the collection. The returned value
will not be affected by subsequent calls to nextState (or nthPreviousState ) which
use the original state argument. The returned value may or may not be the same as the
argument state, depending on the implementation of nextState .
If intoState is supplied, that state object may be destructively modified and returned.
The default copyState handler for collections simply returns the given state.
Note: An object intending to support the Collection Protocol must implement this
handler.◆

me (a Collection)
state
[intoState]

Page 160
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e m p t y o f C o l l e c t i o n

See Also

initialState (for a discussion of collection iteration states), nextState

empty of Collection
empty me
Returns True if the given collection is empty, and False otherwise.
The default empty handler for collections calls initialState and returns True if the
result is False , and False otherwise.
Note: An object intending to support the Collection Protocol need not implement this
handler, i.e. it may inherit it from Collection. It may, however, choose to implement it in
order to perform the operation more efficiently than the default implementation.◆

me (a Collection)

equalTo of Collection
equalTo me, other
with exactmatch
If both collections are collectionLike , this handler does an item-wise comparison of
them and returns True if they have the same number of items and all corresponding
items are equal (as determined by = with the given exactMatch argument), and False
otherwise.
If either collection is not collectionLike , this handler returns True if the two
collections are the same object, and False otherwise.

me (a Collection)
other (a Collection)
[with exactMatch] (a boolean)

See Also

equalTo of Object , greaterThan

extractSubCollection of Collection
extractSubCollection me, fromState, toState
Note: An object intending to support the Collection Protocol need not implement this
handler, i.e. it may inherit it from Collection. It may, however, choose to implement it in
order to perform the operation more efficiently than the default implementation.◆

Page 161
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
fi n a l S t a t e o f C o l l e c t i o n

me (a Collection)
fromState: The state of the start of the subrange to extract; if False , the
subrange begins with the first item of me.
toState: The state following the end of the subrange to extract; if False , the
subrange ends with the last item of me.

finalState of Collection
finalState me
This handler is analogous to initialState, but it creates and returns a state object
corresponding to the final item rather than the first one. The result will be false if and only
if the collection is empty.
Note: An object intending to support the Collection Protocol need not implement this
handler, i.e. it may inherit it from Collection. It may, however, choose to implement it in
order to perform the operation more efficiently than the default implementation.◆

me (a Collection)

See Also

initialState (for a discussion of collection iteration states), initialStateTyped,


finalStateTyped, nextState, nextStateTyped, nthPreviousState, nthPreviousStateTyped

finalStateTyped of Collection
finalStateTyped me, type
This handler is analogous to initialStateTyped, but it creates and returns a state object
corresponding to the final item of the given type rather than the first one. The result will
be false if and only if the collection contains no items of the given type.
Note: An object intending to support the Collection Protocol need not implement this
handler, i.e. it may inherit it from Collection. It may, however, choose to implement it in
order to perform the operation more efficiently than the default implementation.◆

me (a Collection)
type

See Also

initialState (for a discussion of collection iteration states), initialStateTyped, finalState,


nextState, nextStateTyped, nthPreviousState, nthPreviousStateTyped

Page 162
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
g r e a t e r T h a n o f C o l l e c t i o n

greaterThan of Collection
greaterThan me, other
Does an item-wise comparison of the two collections and returns True if any item of me
is greater than the corresponding item of other.

me (a Collection)
other (a Collection)

See Also

greaterThan of Object , equalTo

initialState of Collection
initialState me
This handler is used to start an iteration over a collection by creating and returning an
initial state object. The result will be False if and only if the collection is empty.
The collection protocol centers on the notion of a “state” object for an iteration. Each type
of collection chooses its own most appropriate representation for its state, and only the
handlers of the collection protocol are affected by this choice. For all collections, however,
a state of False is used to indicate that the iteration has completed, i.e. that it has passed
over the final item in the collection.
The representation for a collection's state is generally chosen to maximize efficiency of
access to the corresponding item, and efficiency of computation of the following state. A
vector, for example, might use an integer offset as its state, whereas a linked-list would be
better off using a list-cell as its state.
Note: An object intending to support the Collection Protocol must implement this
handler.◆

me (a Collection)

See Also

initialStateTyped, finalState, finalStateTyped, nextState, nextStateTyped, nthPreviousState,


nthPreviousStateTyped

initialStateTyped of Collection
initialStateTyped me, type
This handler is used to start an iteration over a collection by creating and returning a state
object corresponding to the first item of the given type. The result will be false if and only
if the collection contains no items of the given type.

Page 163
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n s e r t A f t e r C u r r e n t I t e m o f C o l l e c t i o n

The default initialStateTyped handler for collections searches through the items of the
collection to find one of the given type; if it finds one, it terminates the iteration and
returns the corresponding state; otherwise it returns false.
Note: A pseudo-typed collection intending to support the Collection Protocol must
implement this handler.
A pseudo-typed collection is a collection for which “type-filtering” behaves differently
than the simple default type-filtering, which selects items from a collection only if they
descend from a given type. In other words a collection C is pseudo-typed if, for some type
SomeType and some index N, “SomeType N of C” cannot simply be interpreted as “the
(N)th item that is a SomeType in C”. Descendants of Text, for example, are pseudo-typed
(consider that “word 1 of "Good morning"” cannot simply be interpreted as “the 1st item
that is a word in "Good morning"”).◆

me (a Collection)
type

See Also

initialState (for a discussion of collection iteration states), finalState, finalStateTyped,


nextState, nextStateTyped, nthPreviousState, nthPreviousStateTyped

insertAfterCurrentItem of Collection
insertAfterCurrentItem me, state, newitem, dependentStates
Note: An object intending to support the Collection Protocol must implement this
handler.◆

me (a Collection)
state
newItem
[dependentStates]

See Also

initialState (for a discussion of collection iteration states), insertInto ,


insertBeforeCurrentItem

insertBeforeCurrentItem of Collection
insertBeforeCurrentItem me, state, newitem, dependentStates
Note: An object intending to support the Collection Protocol must implement this
handler.◆

Page 164
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n s e r t I n t o o f C o l l e c t i o n

me (a Collection)
state
newItem
[dependentStates]

See Also

initialState (for a discussion of collection iteration states), insertInto ,


insertAfterCurrentItem

insertInto of Collection
insertInto me, newitem, dependentStates
Note: An object intending to support the Collection Protocol need not implement this
handler, i.e. it may inherit it from Collection. It may, however, choose to implement it in
order to perform the operation more efficiently than the default implementation.◆

me (a Collection)
newItem
[dependentStates]

See Also

initialState (for a discussion of collection iteration states),


insertBeforeCurrentItem , insertAfterCurrentItem

mapItems of Collection
mapItems me, fromState, toState, functionorname
This handler maps over the specified range of items in the given collection, at each item
calling functionOrName with a single argument: the current item.
Note: An object intending to support the Collection Protocol need not implement this
handler, i.e. it may inherit it from Collection. It may, however, choose to implement it in
order to perform the operation more efficiently than the default implementation.◆

me (a Collection)
fromState: The state from which the mapping is to begin; if False , the
mapping begins at the first item of me.
toState: The state before which the mapping is to end; if False , the
mapping ends at the last item of me.
functionOrName (a Function or a Symbol)

Page 165
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a p I t e m s Ty p e d o f C o l l e c t i o n

See Also

mapItemsTyped , mapStates , mapStatesTyped , mapStatesForMods ,


mapStatesForModsTyped , initialState (for a discussion of collection iteration
states)

mapItemsTyped of Collection
mapItemsTyped me, type, fromState, toState, functionorname
This handler maps over those items conforming to the given type constraint in the
specified range of items in the given collection, at each item calling functionOrName with
a single argument: the current item.
Note: An object intending to support the Collection Protocol need not implement this
handler, i.e. it may inherit it from Collection. It may, however, choose to implement it in
order to perform the operation more efficiently than the default implementation.◆

See Also

mapItems , mapStates , mapStatesTyped , mapStatesForMods ,


mapStatesForModsTyped , initialState (for a discussion of collection iteration
states)

mapStates of Collection
mapStates me, fromState, toState, functionorname
Note: An object intending to support the Collection Protocol need not implement this
handler, i.e. it may inherit it from Collection. It may, however, choose to implement it in
order to perform the operation more efficiently than the default implementation.◆

me (a Collection)
fromState: The state from which the mapping is to begin; if False , the
mapping begins at the first item of me.
toState: The state before which the mapping is to end; if False , the
mapping ends at the last item of me.
functionOrName (a Function or a Symbol)

See Also

mapItems , mapItemsTyped , mapStatesTyped , mapStatesForMods ,


mapStatesForModsTyped , initialState (for a discussion of collection iteration
states)

mapStatesForMods of Collection
mapStatesForMods me, fromState, tostateholder, functionorname

Page 166
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a p S t a t e s F o r M o d s Ty p e d o f C o l l e c t i o n

Maps from the item at fromState (or the 1st item, if fromState is False ), to the item before
the state in toStateHolder (or the last item, if that state is False ). The toStateHolder must
be a one-item list holding a state (which may be False )
The functionOrName must take three arguments —the state, the nextState and the
toStateHolder— and return the nextState; it must update both the nextState and the state
in toStateHolder if necessary.
Note: An object intending to support the Collection Protocol need not implement this
handler, i.e. it may inherit it from Collection. It may, however, choose to implement it in
order to perform the operation more efficiently than the default implementation.◆

me (a Collection)
fromState
toStateHolder
functionOrName (a Function or a Symbol)

See Also

mapItems , mapStates , mapItemsTyped , mapStatesTyped ,


mapStatesForModsTyped , initialState (for a discussion of collection iteration
states)

mapStatesForModsTyped of Collection
mapStatesForModsTyped me, type, fromState, tostateholder,
functionorname
Maps from the item at fromState (or the 1st item, if fromState is False ), to the item before
the state in toStateHolder (or the last item, if that state is False ). The toStateHolder must
be a one-item list holding a state (which may be False )
The functionOrName must take three arguments —the state, the nextState and the
toStateHolder— and return the nextState; it must update both the nextState and the state
in toStateHolder if necessary.

me (a Collection)
type
fromState
toStateHolder
functionOrName (a Function or a Symbol)

See Also

mapItems , mapStates , mapItemsTyped , mapStatesTyped , mapStatesForMods ,


initialState (for a discussion of collection iteration states)

Page 167
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a p S t a t e s Ty p e d o f C o l l e c t i o n

mapStatesTyped of Collection
mapStatesTyped me, type, fromState, toState, functionorname
Note: An object intending to support the Collection Protocol need not implement this
handler, i.e. it may inherit it from Collection. It may, however, choose to implement it in
order to perform the operation more efficiently than the default implementation.◆

me (a Collection)
type
fromState: The state from which the mapping is to begin; if False , the
mapping begins at the first item of me.
toState: The state before which the mapping is to end; if False , the
mapping ends at the last item of me.
functionOrName (a Function or a Symbol)

nextState of Collection
nextState me, state
Given the collection and an existing state, this handler “steps” a collection iteration by
producing and returning a state corresponding to the next item. This may or may not
modify (and reuse) the given state; it is therefore an error to use a state value after it has
been passed to nextState (so a script needing to return to a particular state in an iteration
must use a copy of that state, as obtained from the copyState handler).
Note: An object intending to support the Collection Protocol must implement this
handler.◆

me (a Collection)
state

See Also

initialState (for a discussion of collection iteration states), initialStateTyped, finalState,


finalStateTyped, nextStateTyped, nthPreviousState, nthPreviousStateTyped

nextStateTyped of Collection
nextStateTyped me, type, state
Given the collection and an existing state, this handler “steps” a collection iteration by
producing and returning a state corresponding to the next item of the given type. This
may or may not modify (and reuse) the given state; it is therefore an error to use a state
value after it has been passed to nextStateTyped (so a script needing to return to a
particular state in an iteration must use a copy of that state, as obtained from the
copyState handler).

Page 168
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
n t h I t e m Ty p e d o f C o l l e c t i o n

The default nextStateTyped handler for collections searches through the items of the
collection, starting at the given state, to find one of the given type; if it finds one, it
terminates the iteration and returns the corresponding state; otherwise it returns false.
Note: A pseudo-typed collection intending to support the Collection Protocol must
implement this handler. (See initialStateTyped for the definition of a pseudo-typed
collection.)◆

me (a Collection)
type
state

See Also

initialState (for a discussion of collection iteration states), initialStateTyped, finalState,


finalStateTyped, nextState, nthPreviousState, nthPreviousStateTyped

nthItemTyped of Collection
nthItemTyped me, type, n
Note: An object intending to support the Collection Protocol need not implement this
handler, i.e. it may inherit it from Collection. It may, however, choose to implement it in
order to perform the operation more efficiently than the default implementation.◆

me (a Collection)
type
n

nthPreviousState of Collection
nthPreviousState me, n, fromState
From the item before fromState (or from the last item, if fromState is False )
Note: An object intending to support the Collection Protocol must implement this
handler.◆

me (a Collection)
n
fromState

See Also

initialState (for a discussion of collection iteration states), initialStateTyped ,


finalState , finalStateTyped , nextState , nextStateTyped ,
nthPreviousStateTyped

Page 169
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
n t h P r e v i o u s S t a t e Ty p e d o f C o l l e c t i o n

nthPreviousStateTyped of Collection
nthPreviousStateTyped me, type, n, fromState
From the item before fromState (or from the last item, if fromState is False )
Note: A pseudo-typed collection intending to support the Collection Protocol must
implement this handler. (See initialStateTyped for the definition of a pseudo-typed
collection.)◆

me (a Collection)
type
n
fromState

See Also

initialState (for a discussion of collection iteration states), initialStateTyped, finalState,


finalStateTyped, nextState, nextStateTyped, nthPreviousState

nthState of Collection
nthState me, n, fromState
Computes and returns the nth state from the item after fromState (or from the 1st item, if
fromState is False ).
Note: An object intending to support the Collection Protocol need not implement this
handler, i.e. it may inherit it from Collection. It may, however, choose to implement it in
order to perform the operation more efficiently than the default implementation.◆

me (a Collection)
n
fromState

See Also

initialState (for a discussion of collection iteration states)

nthStateTyped of Collection
nthStateTyped me, type, n, fromState
Computes and returns the state corresponding to the nth item from the item after
fromState (or from the start, if fromState is False ) that conforms to the given type
constraint.
Note: An object intending to support the Collection Protocol need not implement this
handler, i.e. it may inherit it from Collection. It may, however, choose to implement it in
order to perform the operation more efficiently than the default implementation.◆

Page 170
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
n u m I t e m s o f C o l l e c t i o n

me (a Collection)
type
n
fromState

See Also

initialState (for a discussion of collection iteration states)

numItems of Collection
numItems me, fromState, toState
Returns the number of items from the item at fromState (or the 1st item, if fromState is
False ), to the item before toState (or the last item, if toState is False ).

Note: The function length provides a high-level simple interface to the numItems
handler.◆
Note: An object intending to support the Collection Protocol need not implement this
handler, i.e. it may inherit it from Collection. It may, however, choose to implement it in
order to perform the operation more efficiently than the default implementation.◆

me (a Collection)
fromState
toState

See Also

length , initialState (for a discussion of collection iteration states)

numItemsTyped of Collection
numItemsTyped me, type, fromState, toState
Returns the number of items that conform to the given type constraint from the item at
fromState (or the 1st item, if fromState is False ), to the item before toState (or the last
item, if toState is False ).
Note: An object intending to support the Collection Protocol need not implement this
handler, i.e. it may inherit it from Collection. It may, however, choose to implement it in
order to perform the operation more efficiently than the default implementation.◆

me (a Collection)
type
fromState
toState

Page 171
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o b j e c t A s L i s t o f C o l l e c t i o n

See Also

initialState (for a discussion of collection iteration states)

objectAsList of Collection
objectAsList me
with project

me (a Collection)
[with project]

objectAsString of Collection
objectAsString me
with project

me (a Collection)
[with project]

positionOfItem of Collection
positionOfItem me, item
with start
with end
with test
with exactmatch
Returns the position (a positive integer) of the item's first occurrence in me, or False if it
does not occur at all.
Note: The function position provides a high-level simple interface to the
positionOfItem handler.◆

Note: An object intending to support the Collection Protocol need not implement this
handler, i.e. it may inherit it from Collection. It may, however, choose to implement it in
order to perform the operation more efficiently than the default implementation.◆

me (a Collection)
item
[with test] (a Function or a Symbol): Test to be used for item comparison;
defaults to '=' .
[with exactMatch] (a boolean): If a specific test is not supplied, this value is
used for the exactMatch argument when calling = .

Page 172
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e m o v e C u r r e n t I t e m o f C o l l e c t i o n

See Also

position

removeCurrentItem of Collection
removeCurrentItem me, state, dependentStates
Note: An object intending to support the Collection Protocol must implement this
handler.◆

me (a Collection)
state
[dependentStates]

See Also

initialState (for a discussion of collection iteration states)

stateEqual of Collection
stateEqual me, state1, state2
This handler returns True if both state1 and state2 correspond to the same position in the
given collection, and False otherwise.
Note: An object intending to support the Collection Protocol must implement this
handler.◆

me (a Collection)
state1
state2

See Also

initialState (for a discussion of collection iteration states), stateGreaterThan

stateGreaterThan of Collection
stateGreaterThan me, state1, state2
This handler returns True if the position to which state1 corresponds comes after the
position to which state2 corresponds (with respect to the collection's iteration order), and
False otherwise.

Note: An object intending to support the Collection Protocol must implement this
handler.◆

Page 173
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s t a t e O f I t e m o f C o l l e c t i o n

me (a Collection)
state1
state2

See Also

initialState (for a discussion of collection iteration states), stateEqual

stateOfItem of Collection
stateOfItem me, item
with start
with end
with test
with exactmatch
Returns the state of the item's first occurrence in me, or False if it does not occur at all.
Note: An object intending to support the Collection Protocol need not implement this
handler, i.e. it may inherit it from Collection. It may, however, choose to implement it in
order to perform the operation more efficiently than the default implementation.◆

me (a Collection)
item
[with test] (a Function or a Symbol): Test to be used for item comparison;
defaults to '=' .
[with exactMatch] (a boolean): If a specific test is not supplied, this value is
used for the exactMatch argument when calling = .

See Also

initialState (for a discussion of collection iteration states), positionOfItem

writeObject of Collection
writeObject me, thestream, rereadably

me (a Collection)
thestream (a TextStream)
rereadably (a boolean)

Page 174
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d i s p l a y s a m p l e o f C o l o r C u r s o r R S R C

ColorCursorRSRC
(a Media)

The resource object that handler color cursors (resources of type "curs").

Handlers of ColorCursorRSRC

displaysample of ColorCursorRSRC
displaysample me, theactor
Displays the media in the actor specified. In this case, all we do is set the cursor of the
Stage to the ColorCursorRSRC in question.

me (a ColorCursorRSRC)
theActor (an Actor)

See Also

the cursor of the Stage .

ColorPattern
(a Media)

Parent object of color pattern resources. Color pattern can be displayed by making them the media of an
imageRenderer.

See Also
ImageRenderer.

Page 175
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b o u n d s r e c t o f C o l o r P a t t e r n

Handlers of ColorPattern

boundsrect of ColorPattern
boundsRect me
Returns the physical rectangle that encloses the image stored in this media object.

me (a ColorPattern)

defaultrenderstyle of ColorPattern
defaultRenderStyle me
Returns the way in which a media of this type is commonly rendered. For the
ColorPattern, this handler returns 'renderTiled' .

me (a ColorPattern)

displaysample of ColorPattern
displaysample me, theactor
Calls showMediaInActor to display the ColorPattern in the actor.

me (a ColorPattern)
theActor (an Actor)

See Also

the function showMediaInActor.

renderstretched of ColorPattern
renderStretched me, therenderer, theactor, region, thepaper
Renders the image in the ColorPattern stretching it to fill the region to be rendered.

Page 176
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e n d e r t i l e d o f C o l o r P a t t e r n

me (a ColorPattern)
therenderer (an ImageRenderer): The renderer whose media is this
ColorPattern.
theactor (an Actor): The actor currently being drawn.
region (a Mask): The region to be painted.
thePaper: The surface on which the drawing takes place. This argument
should be passed "as is" to other render handlers and some handlers
defined on the Pen and Mask objects.

rendertiled of ColorPattern
renderTiled me, therenderer, theactor, region, thepaper
Renders the image stored in the ColorPattern tiling it to fill the region to be painted.

me (a ColorPattern)
therenderer (an ImageRenderer): The renderer whose media is this
ColorPattern.
theactor (an Actor): The actor currently being drawn.
region (a Mask): The region to be painted.
thePaper: The surface on which the drawing takes place. This argument
should be passed "as is" to other render handlers and some handlers
defined on the Pen and Mask objects.

renderunstretched of ColorPattern
renderUnstretched me, therenderer, theactor, region, thepaper
Renders the image stored in the ColorPattern once, placing its topleft corner at the topleft
of the region to be rendered (or offset by the values in the hOffset and vOffset
property of the renderer).

size of ColorPattern
size me
Returns the size in pixels of the image stored by this media object.

me (a ColorPattern)

Page 177
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h o r i z o n t a l s c r o l l o f C o l o r P i c k e r

ColorPicker
(a TablePicker)

This is simply a TablePicker specialized for displaying colors nicely. Whenever it's items are set and
whenever the colorPicker is resized , a new number of rows and columns is computed to optimally
show all of the colors. That is, it computes the appropriate number of rows and columns, based on the
current size, to maintain a square shape for each of the cells.
Note that the colorPicker cannot be scrolled in the usual manner, as it always makes all of it's items
visible at all times. Note also that every item of a colorPicker must be a Renderer.

Example
The following SK8Script can be used to generate a simple palette of the default RGBColors:
new colorPicker with ObjectName "BasicPalette"
set the container of the BasicPalette to the stage
set the boundsrect of the BasicPalette to {30, 30, 150, 100}
set the items of the basicPalette to every item whose project = sk8 in the
knownchildren of rgbcolor
Note we make sure to choose only colors in SK8 as there may be an RGBColor defined in another
project (such as the RGBColors defined in the ProjectBuilder project).

See Also
TablePicker, horizontalScroll , verticalScroll

Properties of ColorPicker

horizontalscroll of ColorPicker
This property has been specialized so that the color picker cannot be scrolled.

Setter
set the horizontalscroll of me
to NewValue

me (a ColorPicker)
to

Page 178
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
v e r t i c a l s c r o l l o f C o l o r P i c k e r

verticalscroll of ColorPicker
This property has been specialized so that the color picker cannot be scrolled.

Setter
set the verticalscroll of me
to NewValue

me (a ColorPicker)
to

CompilationError
(an Error)

The parent object of Compilation error warnings.

See Also
The Condition System section of the User Guide's SK8Script Language chapter

Handlers of CompilationError

writeobject of CompilationError
writeObject me, thestream, rereadably

me (a CompilationError)
thestream
rereadably

Complex
(a Number)

Page 179
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w r i t e o b j e c t o f C o m p i l a t i o n E r r o r

This object is the parent of all complex numbers. Complex numbers consist of a real part (with a real
magnitude) and an imaginary part (also with a real magnitude).
Complex numbers can be created with the function complex , and their real part and imaginary part can
be examined with the functions realPart and imagPart , respectively.

See Also
the function complex , realPart , imagPart

ComplexGradient
(a Gradient)

ComplexGradients are gradients with additional properties to let you control the penMode to be used
when rendering and a start and end OpColor. At each rendering step the Opcolor will be incremented
from the start OpColor to the end OpColor resulting in different degrees of the effect specified with the
penMode .

Example
Consider the BlueBlend renderer. Here are the settings for each of the properties that are new to the
complexGradient:
penmode = 32
startopred = 65535
startopgreen = 65535
startopblue = 65535
endopred = 0
endopgreen = 0
endopblue = 0
The penmode 32 is the 'blend' mode. Note that the start Opcolor has the maximum values for the RGB
components. Since the opColor controls the degree with which to apply the effect, this means that at the
start of rendering this renderer is fully translucent. As we progress towards the end of the rendering, the
renderer becomes less and less translucent until it is opaque.
This renderer is called BlueBlend because start color and end color are Blue. Thus, at the start it blends
blue with the background. Then it blends less and less becoming opaque Blue at the end.

See Also
penmode , startopred , startopgreen , startopblue , endopred , endopgreen and endopblue .

Page 180
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e n d o p b l u e o f C o m p l e x G r a d i e n t

Properties of ComplexGradient

endopblue of ComplexGradient
Stores the blue componend of the complexGradient's ending OpColor.

Getter
get the endOpBlue of me

me (a ComplexGradient)

Setter
set the endopblue of me
to NewValue

me (a ComplexGradient)
to (an Integer)

endopgreen of ComplexGradient
Stores the green componend of the complexGradient's ending OpColor.

Getter
get the endOpGreen of me

me (a ComplexGradient)

Setter
set the endopgreen of me
to NewValue

me (a ComplexGradient)
to (an Integer)

endopred of ComplexGradient
Stores the red componend of the complexGradient's ending OpColor.

Page 181
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p e n m o d e o f C o m p l e x G r a d i e n t

Getter
get the endOpRed of me

me (a ComplexGradient)

Setter
set the endopred of me
to NewValue

me (a ComplexGradient)
to (an Integer)

penmode of ComplexGradient
Stores the penMode this renderer uses to render. The valid options are:
'srccopy' , 'srcor' , 'srcxor' , 'srcbic' , 'notsrccopy' , 'notsrcor' ,
'notsrcxor' , 'notsrcbic' , 'patcopy' , 'pator' , 'patxor' , 'patbic' ,
'notpatcopy' , 'notpator' , 'notpatxor' , 'notpatbic' , 'grayishtextor' ,
'Blend' , 'addpin' , 'addover' , 'subpin' , 'addmax' , 'admax' , 'subover' ,
'admin' , 'dithercopy' , 'Transparent' , and 'highlight' .

See Inside Macintosh for descriptions of each one of these.

Getter
get the penMode of me

me (a ComplexGradient)

Setter
set the penmode of me
to NewValue

me (a ComplexGradient)
to: One of the pen modes listed above.

startopblue of ComplexGradient
Stores the blue component of the complexGradient's starting OpColor.

Getter
get the startOpBlue of me

Page 182
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s t a r t o p g r e e n o f C o m p l e x G r a d i e n t

me (a ComplexGradient)

Setter
set the startopblue of me
to NewValue

me (a ComplexGradient)
to (an Integer)

startopgreen of ComplexGradient
Stores the green componend of the complexGradient's starting OpColor.

Getter
get the startOpGreen of me

me (a ComplexGradient)

Setter
set the startopgreen of me
to NewValue

me (a ComplexGradient)
to (an Integer)

startopred of ComplexGradient
Stores the red componend of the complexGradient's starting OpColor.

Getter
get the startOpRed of me

me (a ComplexGradient)

Setter
set the startopred of me
to NewValue

Page 183
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e n d e r o f C o m p l e x G r a d i e n t

me (a ComplexGradient)
to (an Integer)

Handlers of ComplexGradient

render of ComplexGradient
render me, theactor, region, thepaper
Renders the region specified. Sets the penMode to the complexGradient's penmode . Then
it sets the color to the RGB specified in the startRed , startGreen and startBlue
properties. It also sets the OpColor to the RGB specified in the startOpRed ,
startOpGreen and startOpBlue properties. This determines the degree with which
the effect specified with the penMode will be applied. The rendering then proceeds in
bands (just like in the Gradient renderers). At each step we increment the color to
eventually reach the RGB specified in the endRed , endBlue and endGreen properties
and at the same time we increment the OpColor to reach the RGB specified in the
endOpRed , endOpGreen and endOpBlue properties.

Thus, we could say that the gradient idea is applied to both the renderer's color and its
penmode.

me (a ComplexGradient)
theactor (an Actor): The Actor currently being rendered if any.
region (a Mask): The mask to be rendered.
thePaper: The surface on which the drawing takes place. This argument
should be passed "as is" to other render handlers and some handlers
defined on the Pen and Mask objects.

Translucent of ComplexGradient
Translucent me
Returns True if the renderer's penMode is one of the tranlucent modes.

me (a ComplexGradient)

See Also

penMode and translucent of Renderer.

Page 184
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b a c k b l u e o f C o m p l e x R G B C o l o r

ComplexRGBColor
(a RGBColor)

Complex RGB color object are children of RBGColor with additional controls of background colors and
graphic transfer modes. By changing the penMode and the opColor you can get a variety of interesting
effects. We only use it to create translucent renderers.

See Also
penMode , media , opGreen , opRed , opBlue , backRed , backGreen , backBlue .

Properties of ComplexRGBColor

backblue of ComplexRGBColor
Specifies the blue component of the backColor. A number from 0 to 65535.

Getter
get the backBlue of me

me (a ComplexRGBColor)

Setter
set the backblue of me
to NewValue

me (a ComplexRGBColor)
to (an Integer)

backgreen of ComplexRGBColor
Specifies the green component of the backColor. A number from 0 to 65535.

Getter
get the backGreen of me

me (a ComplexRGBColor)

Page 185
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b a c k r e d o f C o m p l e x R G B C o l o r

Setter
set the backgreen of me
to NewValue

me (a ComplexRGBColor)
to (an Integer)

backred of ComplexRGBColor
Specifies the red component of the backColor. A number from 0 to 65535.

Getter
get the backRed of me

me (a ComplexRGBColor)

Setter
set the backred of me
to NewValue

me (a ComplexRGBColor)
to (an Integer)

Media of ComplexRGBColor
If set to a BWPattern , the pen Pattern is set to it when rendering. This pattern is used in
conjunction with the penMode to achieve interesting effects.

Getter
get the Media of me

me (a ComplexRGBColor)

Setter
set the media of me
to NewValue

me (a ComplexRGBColor)
to: A descendant of BWPattern or False .

Page 186
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o p b l u e o f C o m p l e x R G B C o l o r

opblue of ComplexRGBColor
Specifies the blue component of the opColor A number from 0 to 65535.

Getter
get the opBlue of me

me (a ComplexRGBColor)

Setter
set the opblue of me
to NewValue

me (a ComplexRGBColor)
to (an Integer)

opgreen of ComplexRGBColor
Specifies the green component of the opColor A number from 0 to 65535.

Getter
get the opGreen of me

me (a ComplexRGBColor)

Setter
set the opgreen of me
to NewValue

me (a ComplexRGBColor)
to (an Integer)

opred of ComplexRGBColor
Specifies the red component of the opColor A number from 0 to 65535.

Getter
get the opRed of me

me (a ComplexRGBColor)

Page 187
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p e n m o d e o f C o m p l e x R G B C o l o r

Setter
set the opred of me
to NewValue

me (a ComplexRGBColor)
to (an Integer)

penmode of ComplexRGBColor
This property stores the penMode to be used for rendering this renderer. The valid
options are:
'srccopy' , 'srcor' , 'srcxor' , 'srcbic' , 'notsrccopy' , 'notsrcor' ,
'notsrcxor' , 'notsrcbic' , 'patcopy' , 'pator' , 'patxor' , 'patbic' ,
'notpatcopy' , 'notpator' , 'notpatxor' , 'notpatbic' , 'grayishtextor' ,
'Blend' , 'addpin' , 'addover' , 'subpin' , 'addmax' , 'admax' , 'subover' ,
'admin' , 'dithercopy' , 'Transparent' , and 'highlight' .

See Inside Macintosh for descriptions of each one of these.

Getter
get the penMode of me

me (a ComplexRGBColor)

Setter
set the penmode of me
to NewValue

me (a ComplexRGBColor)
to: One of the modes listed above.

Handlers of ComplexRGBColor

render of ComplexRGBColor
render me, theactor, region, thepaper
Paints the region specified. The sequence of events is the following:
We set the opColor to the RGB specified in the opBlue , opRed and opGreen properties.
Then we set the foreColor and the backColor using the fore and back properties. If a

Page 188
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
Tr a n s l u c e n t o f C o m p l e x R G B C o l o r

BWPattern is available in the media property, we set the penPat to it. Then we paint the
region and reset the pen.

me (a ComplexRGBColor)
theactor (an Actor): The actor currently being drawn.
region (a Mask): The region to be painted.
thePaper: The surface on which the drawing takes place. This argument
should be passed "as is" to other render handlers and some handlers
defined on the Pen and Mask objects.

Translucent of ComplexRGBColor
Translucent me
Returns whether or not me (a ComplexRGBColor) is translucent. All it does is check
whether the renderer's penMode is one of the translucent modes.

me (a ComplexRGBColor)

See Also

penMode , translucent of Renderer.

ComponentManagerError
(a SystemError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

Condition
(an Object)

Page 189
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n v o k a b l e o f C o n d i t i o n R e s p o n s e

ConditionResponse
(an Object)

This object represents a category of objects for responding to conditions. Each condition response object
must define an invokable handler, an invoke handler and, optionally, a writeObject handler.
The invokable handler must return True if this response is currently invokable, and False otherwise.
The default handler always returns True .
The invoke handler performs the response action. Generally, this handler will either “recover” from the
condition, “abort” from it, or enter some kind of interactive mode for allowing the user a choice of ways
of recovering or aborting from the condition.
Note that SK8 will never call invoke in response to a particular condition without first having called the
response object's invokable handler and gotten True as its value. Thus any implementation of the
invoke handler may assume its response object is currently invokable. Consequently, you should be
sure never to directly call a response object's invoke handler without first verifying that its invokable
handler returns True immediately before.
The writeObject handler for a ConditionResponse , when its rereadably argument is False ,
should write the following information about the response. If the response is invokable, it should write a
description of exactly what this response will do when invoked (typically, phrased as a question, as in
“Would you like me to try to find the missing object on the disk?”). If the response is not invokable, the
writeObject handler should write an explanation of why it is not.

Note: The invokable , invoke and writeObject handlers may examine the function
currentCondition , which will return the condition object of the current condition being signalled.◆

See Also
invokable , invoke , conditionResponses of Project , the Condition System section of the User
Guide's SK8Script Language chapter

Handlers of ConditionResponse

invokable of ConditionResponse
invokable me
Returns True if this response is currently invokeable, and False otherwise. The default
handler (i.e. the one defined for ConditionResponse ) always returns True .
Note: The invokable handler may examine the function currentCondition , which
will return the condition object of the current condition being signalled.◆

Page 190
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n v o k e o f C o n d i t i o n R e s p o n s e

me (a ConditionResponse)

See Also

ConditionResponse

invoke of ConditionResponse
invoke me
The invoke handler performs the response action. Generally, this handler will either
“recover” from the condition, “abort” from it, or enter some kind of interactive mode for
allowing the user a choice of ways of recovering or aborting from the condition.
Note that SK8 will never call invoke in response to a particular condition without first
having called the response object's invokable handler and gotten True as its value.
Thus any implementation of the invoke handler may assume its response object is
currently invokable. Consequently, you should be sure never to directly call a response
object's invoke handler without first verifying that its invokable handler returns True
immediately before.
Note: The invoke handler may examine the function currentCondition , which will
return the condition object of the current condition being signalled.◆

me (a ConditionResponse)

See Also

ConditionResponse

writeObject of ConditionResponse
writeObject me, thestream, rereadably
If rereadably is True , this should just do inherited .
Otherwise, if the response is invokable, it should write a description of exactly what this
response will do when invoked (typically, phrased as a question, as in “Would you like
me to try to find the missing object on the disk?”). If the response is not invokable, the
writeObject handler should write an explanation of why it is not.

Note: The writeObject handler may examine the function currentCondition ,


which will return the condition object of the current condition being signalled.◆

me (a ConditionResponse)
theStream (a TextStream)
rereadably (a boolean)

Page 191
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e r r o r c a u s e o f C o n d i t i o n S y s t e m E r r o r

See Also

ConditionResponse , writeObject of Object

ConditionSystemError
(a SystemError)

Properties of ConditionSystemError

errorcause of ConditionSystemError

Getter
get the errorCause of me

Setter
set the errorcause of me
to NewValue

originalcondition of ConditionSystemError

Getter
get the originalCondition of me

Setter
set the originalcondition of me
to NewValue

response of ConditionSystemError

Getter
get the response of me

Page 192
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w r i t e o b j e c t o f C o n d i t i o n S y s t e m E r r o r

Setter
set the response of me
to NewValue

Handlers of ConditionSystemError

writeobject of ConditionSystemError
writeObject me, thestream, rereadably

me (a ConditionSystemError)
thestream
rereadably

Connector
(a LineSegment)

The connector actor is a child of LineSegment with extra properties that allow automatic connection
between two actors. Connectors are useful whenever you want a LineSegment to automatically maintain
a connection between actors.
Connectors are automatically created by calling the Actor connect handler.
Connectors attach to actors in various ways, which are controled by the startGeometry and
endGeometry properties. The valid options are 'center' , 'projectCenter' , 'horizontalEdge' ,
'verticalEdge' and 'closestEdge' .

The connections created with connectors are directional: you specify a startActor and an endActor. Thus,
you can ask an actor what is connected to and what it is connected from. You can also ignore the
direction by asking the actor for all the actors connected to it in any direction.

See Also
The connector properties: startActor, endActor, startGeometry and endGeometry and the Actor
handlers: connect , connectors , connectedActors , connectedTo and connectedFrom .

Page 193
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e n d a c t o r o f C o n n e c t o r

Properties of Connector

endactor of Connector
This property specifies the Actor that is attached to the end of the connector. Usually the
connect handler sets this property.

Getter
get the endActor of me

me (a Connector)

Setter
set the endactor of me
to NewValue

me (a Connector)
to: The actor to be attached to the end of the connector.

See Also

connect of Actor, and startActor.

endgeometry of Connector
This property controls the way in which the connector attaches itself to its endActor. The
options are: 'center' , 'projectCenter' , 'horizontalEdge' , 'verticalEdge'
and 'closestEdge' .

Getter
get the endGeometry of me

me (a Connector)

Setter
set the endgeometry of me
to NewValue

Page 194
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s t a r t a c t o r o f C o n n e c t o r

me (a Connector)
to: One of 'center' , 'projectCenter' , 'horizontalEdge' ,
'verticalEdge' and 'closestEdge' .

startactor of Connector
This property specifies the actor that is attached to the start of the connector. Usually the
connect handler sets this property.

Getter
get the startActor of me

Setter
set the startactor of me
to NewValue

me (a Connector)
to: An actor or False .

See Also

connect of Actor, endActor.

startgeometry of Connector

Getter
get the startgeometry of me

This property controls the way in which the connector attaches itself to its startActor.
The options are: 'center' , 'projectCenter' , 'horizontalEdge' ,
'verticalEdge' and 'closestEdge' .

me (a Connector)

Setter
set the startgeometry of me
to NewValue

Page 195
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i s o l a t e o f C o n n e c t o r

me (a Connector)
to: One of 'center' , 'projectCenter' , 'horizontalEdge' ,
'verticalEdge' and 'closestEdge' .

Handlers of Connector

isolate of Connector
isolate me
Sets the startActor and the endActor of the connector to False , thus isolating the
connector from anything it was connected to.

me (a Connector)

See Also

startActor, endActor and disconnect of Actor.

reverseconnection of Connector
reverseConnection me
with affectarrows
This handler reverses the connector's connection by making its startActor be its
endActor, and its endActor its startActor.

Note: It is an error to call this handler when the Connector is not connecting two actors.◆

me (a Connector)
[with affectarrows] (a boolean): Controls whether any arrows in the
connector should be changed to graphically reflect the change in the
connection. Defaults to True .

See Also

startActor, endActor and the DirectionalConnector object.

update of Connector
update me

Page 196
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
u p d a t e o f C o n n e c t o r

The update handler recomputes the connector's position to ensure it is still attached to the
actors it connects.

me (a Connector)

ConstantSheet
(a TextList)

This is a TextList whose PickerPrototype has been set to ConstantSheetPicker. Therefore it


provides a nice scrollable version of this browser component. Note that the TextList itself has none of
the browsing functionality, it's Picker does. Thus, whenever you wish to get at the browsing
functionality, you should access the object tagged as the Picker of this object.

Example
set the inputProject of the Picker of SuperCoolConstantSheet to SK8

ConstantSheetPicker
(a ProjectDataSheetPicker)

This is a ProjectDataSheetPicker with it's properties set so it shows only contstants.

CursorRSRC
(a Media)

The parent of all black and white cursor ("CURS") resources. You can use cursor resources by setting the
cursor property of the Stage to them.

See Also
the cursor of the Stage .

Page 197
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d i s p l a y s a m p l e o f C u r s o r R S R C

Handlers of CursorRSRC

displaysample of CursorRSRC
displaysample me, theactor
Displays the media in the actor specified. In this case, all we do is set the cursor of the
Stage to the cursorRSRC in question.

me (a CursorRSRC)
theActor (an Actor)

See Also

the cursor of the Stage .

DataObject
(an Object)

Since many times users will be representing raw data in the form of objects, this object exists simply as a
way of deepening the hierarchy. That is, such data objects will be children of this rather than of object
itself. This makes it so that while browsing the hierarchy isn't cluttered. It has no other meaning.

DateTime
(an Object)

DateTime supports the convenient storage and type coercion of calendar dates and times. For example,
the DateTime object can coerce a text string such as "September 21, 1968", "21 sept 68", "9/21/68", or
"12:07 pm" into a value which can be compared to other dates.
DateTime object uses storage similar to the Macintosh's, counting the seconds since January 1, 1904.

DateTime and its children may be coerced into strings (text) or integers (numbers) by using classic
SK8Script coercion. For example,
DateTime as a string returns "October 5, 1994"

Page 198
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d a t e S t r i n g o f D a t e Ti m e

Now as a number returns 2864201917 (the seconds since 1904)

DateTime and its children may be compared with predicates such as = ,<> , < ,> , etc. "A<B" means A is
before B; i.e., less than is defined as coming before.

Example
mybirthday \< Now returns True

Properties of DateTime

dateString of DateTime
The dateString handler lets you get the string representation of the date, or to set the
date based on a string.
Note that the value returned by a getter may not be the same exact value to which the
property was set. For example, after setting a DateTime 's datesting to "4 jun 1993",
getting the DateTime's datestring would return "June 4, 1993".

Getter
get the datestring of me
with numericform
with abbreviation
with dayofweek

If numericForm is True , a numeric string is returned, for example, "9/21/68". If


DayOfWeek is True , the day of the week is prepended to the string, separated by a
comma. If abbreviation is True , the string is abbreviated form, for example, "Feb 2, 1993".

me (a DateTime)
[with numericForm]
[with abbreviation]
[with dayOfWeek]

Setter
set the datestring of me
to NewValue

me (a DateTime)
to

Page 199
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d a y o f D a t e Ti m e

day of DateTime

Getter
get the day of me

The day handler sets or returns the day of month of the date, as an integer.

me (a DateTime)

Setter
set the day of me
to NewValue

me (a DateTime)
to

Example
new DateTime with objectName "BeginVacation"
set BeginVacation's datestring to "july 4, 1994"
get the day of beginVacation
set the day of beginVacation to 11
get BeginVacation's datestring
set day of DateTime to Integer

era of DateTime

Getter
get the era of me

The era handler sets or returns the era of the date, as an integer. 0 means AD.

me (a DateTime)

Setter
set the era of me
to NewValue

Page 200
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h o u r o f D a t e Ti m e

me (a DateTime)
to

hour of DateTime
The hour of the day of me (a DateTime ) as an integer from zero to 23.

Getter
get the hour of me

me (a DateTime)

Setter
set the hour of me
to NewValue

me (a DateTime)
to

minute of DateTime
The minutes portion of time of me (a DateTime ).

Getter
get the minute of me

me (a DateTime)

Setter
set the minute of me
to NewValue

me (a DateTime)
to

Page 201
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o n t h o f D a t e Ti m e

month of DateTime

Getter
get the month of me

The month handler sets or returns the month of the year of the dateTime, as an integer.

me (a DateTime)

Setter
set the month of me
to NewValue

me (a DateTime)
to

Example
get the month of beginVacation
set the month of beginVacation to Integer

pm of DateTime

Getter
get the pm of me

pm returns True or False , depending if the time is PM or AM.

me (a [[DateTime]])

Setter
set the pm of me
to NewValue

Setting from False to True is equivalent to setting the hour to itself + 12 .

Setting from True to False is equivalent to setting the hour to itself - 12 .

Page 202
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e c o n d s o f D a t e Ti m e

me (a [[PROPERTY (virtual)
to

seconds of DateTime
The seconds part of the time of day from me (a DateTime ).

Getter
get the seconds of me

me (a [[DateTime]])

Setter
set the seconds of me
to NewValue

me (a [[PROPERTY (virtual)
to

secondssince1904 of DateTime
An integer representing the number of seconds between midnight, January 1, 1904, and
the calendar date represented. This property behaves slightly differently for DateTime
than it does for DateTime 's descendants. The secondssince1904 of DateTime returns the
current time on the Macintosh's clock. For descendants of DateTime , the default value is
copied from the new object's parent; if the parent is DateTime then the default value is
the number of seconds between 1904 and midnight of the day the new DateTime object
was made. The secondssince1904 of DateTime cannot be set, although setting the
secondssince1904 of its descendants is allowed.

Getter
get the secondsSince1904 of me

The number of seconds between January 1, 1904 and the time the represented by the
DateTime object.

me (a DateTime)

Page 203
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t i m e S t r i n g o f D a t e Ti m e

Setter
set the secondssince1904 of me
to NewValue

Example
SecondsSince1904 of DateTime

timeString of DateTime
The timeString handler lets you get the string representation of the time of day, or to
set the time of day based on a string.
Note that the value returned by a getter may not be the same exact value to which the
property was set. For example, after setting a DateTime 's timeString to "12:07 pm",
getting the DateTime's datestring would return "12:07 PM".

Getter
get the timeString of me
with seconds

me (a DateTime)

Setter
set the timestring of me
to NewValue

me (a [[DateTime]])
to

year of DateTime

Getter
get the year of me

The year handler sets or returns the year of the dateTime, as an integer.

me (a DateTime)

Page 204
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a g e O f M o o n o f D a t e Ti m e

Setter
set the year of me
to NewValue

me (a [[DateTime]])
to

Example
get the year of beginVacation
set the year of beginVacation to Integer

Handlers of DateTime

ageOfMoon of DateTime
ageOfMoon me
ageOfMoon returns how far around the moon has gone since the last new moon. The
values returned are in radians, from 0 to 2Pi. 0 is new moon and Pi is full moon.
The calculation is based on the book "Practical Astronomy with Your Calculator", Third
Edition, by Peter Duffett-Smith. Cambridge University Press, 1988.

me (a [[DateTime]])

dayName of DateTime
dayName me
dayName is similar to DayOfWeek , except it returns a string, e.g., "Monday".

me (a DateTime)

See Also

dayOfWeek .

dayOfWeek of DateTime
dayOfWeek me

Page 205
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d a y O f Ye a r o f D a t e Ti m e

dayOfWeek returns an integer between 1 and 7, representing the day of the week for a
given date, i.e., , Sunday equals 1 and Saturday equals 7.

me (a DateTime)

Example
set the datestring of beginVacation to "28 june 93"
get the dayofweek of beingVacation
Returns 2, for Monday.

dayOfYear of DateTime
dayOfYear me
dayOfYear returns an integer representing the number of days since the year

has begun.
Note: There is no DayOfMonth . That's simply what Day is.◆

me (a DateTime)

Example
get the dayofyear of beginvactaion returns 178

get the dayofyear of newYearsDay returns 1

daysbetween of DateTime
daysBetween me, date2
Determines how many days apart two dates are.

me (a DateTime)
date2 (a DateTime)

Example
new DateTime with objectname "myBirthDay" with datestring "21
sept 68"
daysbetween mybirthday, Now Returns 8900

Page 206
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d a y s i n m o n t h o f D a t e Ti m e

daysinmonth of DateTime
daysInMonth me
The daysInMonth handler tells you the number of days in a given month, handling leap
years correctly.

me (a DateTime)

Example
daysinMonth Now returns 28

daysinMonth Now (assuming it's February and a leap year) returns 29

equalTo of DateTime
equalTo me, other
with exactmatch
Checks that the given dateTime and me both can be evaluated by the
secondsSince1904 handler, and that the dates (i.e. not including the time), derived
from secondsSince1904 , are equal.

me (a DateTime)
date2 (a DateTime)

greaterThan of DateTime
greaterThan me, other
Returns True if the given dateTime is less than or equal to me.

me (a DateTime)
date2 (a DateTime)

initialize of DateTime
initialize me, original, isnew, initargs
Copies the secondsSince1904 from original to the secondsSince1904 of me, the
new DateTime . If original is the DateTime object, then the date is copied but the time is
set to midnight.

Page 207
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l u n a r P h a s e o f D a t e Ti m e

me (a DateTime)
original
child
args

lunarPhase of DateTime
lunarPhase me
lunarPhase returns a number between 0 and 1. 0 is a new moon, 1 is a full moon.
Note: Based on the book Practical Astronomy with Your Calculator,
Third Edition, by Peter Duffett-Smith. Cambridge University Press,
1988.

me (a DateTime)

monthName of DateTime
monthName me
monthName returns a string corresponding to the month of the DateTime object.

me (a DateTime)

Example
monthname of mybirthday returns "September" .

monthsBetween of DateTime
monthsBetween me, date2
Returns the number of months between the dates. Dec 31 and Jan 1 are a month apart,
although they are only a day apart.

me (a DateTime)
date2 (a DateTime)

Example
monthsbetween mybirthday, now returns 293 .

Page 208
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
n u m b e r A s o f D a t e Ti m e

numberAs of DateTime
numberAs me, obj
with project

me (a DateTime)
obj
[with project]

objectAsNumber of DateTime
objectAsNumber me
with type
with project

me (a [[DateTime]])
[with type]
[with project]

objectAsString of DateTime
objectAsString me
with project

me (a DateTime)
[with project]

stringAs of DateTime
stringAs me, obj
with project

me (a DateTime)
obj
[with project]

weekOfYear of DateTime
weekOfYear me
weekOfYear returns an integer corresponding to the week of year for the DateTime .

me (a DateTime)

Page 209
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
n a m e o f D e v i c e

Device
(an Object)

Represents a system device. (See the knownChildren for various types of devices.)
Device supports all kinds of devices usually attached to the system environment. SK8 monitors the
operating environment as it loads and as it runs for changes in device configurations. Many types of
devices in an environment are represented by SK8 as descendants of Device.

Example
The following command allows you to see what kinds of devices are supported by the current version of
SK8.
get Device's knownChildren
=> {Monitor, Keyboard, Pointer,StorageDevice,SoundChannel}

Properties of Device

name of Device
Returns the name of the Device.

Getter
get the name of me

Setter
set the name of me
to NewValue

Handlers of Device

writeobject of Device
writeObject me, str, rereadably

Page 210
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o u s e d o w n o f D i a l o g B o x

me (a Device)
str
rereadably

DialogBox
(a Rectangle)

This is the prototype dialog box. It has it's windowStyle set to 'modalDialog' and some basic graphic
properties set. Note you do not have to use this object to make a dialog. See the function
ModalDialog() for more details.

See Also
mousedown

Handlers of DialogBox

mousedown of DialogBox
mouseDown me
By default, this lets the dialog be dragged.

DialogBoxButton
(a RoundRect)

This is the prototype for the standard Mac like buttons that appear in dialog boxes. It's default size and
shape match the Mac specifications.

See Also
DialogBox

Page 211
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e n a b l e d o f D i a l o g B o x B u t t o n

Properties of DialogBoxButton

enabled of DialogBoxButton
This property determines whether the button is enabled or not. In its enabled state, the
button's textColor and frameColor are Black and the autohighlight property is
set to True . In its disabled state, the textColor and frameColor are LightGray and
the autohighlight is set to False .

Getter
get the enabled of me

me (a DialogBoxButton)

Setter
set the enabled of me
to NewValue

Besides changing the value of the property, the setter changes the fillColor, the
textColor and the value of the autohighLight property.

me (a DialogBoxButton)
to (a boolean)

See Also

autohighlight .

DialogBoxCancelButton
(a DialogBoxButton)

This is the prototype for the standard Mac like cancel buttons that may appear in a dialogBox . It's
default size and shape match the Mac specifications. It's text is set to "Cancel".

See Also
DialogBox , ModalDialog() , exitModalState() , click

Page 212
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c l i c k o f D i a l o g B o x C a n c e l B u t t o n

Handlers of DialogBoxCancelButton

click of DialogBoxCancelButton
click me
By default, clicking on a cancelButton calls abortEvent() to exit the dialog eventMode .

me (a DialogBoxCancelButton)

See Also

DialogBox , ModalDialog() , exitModalState()

DialogBoxDisplayEditText
(a DialogBoxEditText)

This is the object used to display information in a dialogBox . This is simply a simpleText with some
graphic properties set to make it look nice. It's text is locked so it can't be modified. Note this is used
when word wrap is desired.

DialogBoxDisplayRectangle
(a Rectangle)

This is the object used to display simple information in dialog boxes. This is simply a rectangle with
some graphic properties set to make it look nice.

See Also
DialogBox

Page 213
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h i g h l i g h t o f D i a l o g B o x H i g h l i g h t e d B u t t o n

DialogBoxEditText
(an EditText)

This is the object used to display editable information is dialog boxes. This is simply a simpleText with
some graphic properties set to make it look nice.

See Also
DialogBoxDisplayEditText

DialogBoxHighlightedButton
(a DialogBoxButton)

This is the prototype for the highlighted version of the standard Mac buttons that appear in dialog
boxes. It's default size and shape match the Mac specifications. By default if the keytarget of the
dialogBox is set to this button, then a return or enter keydown will click the button.

Properties of DialogBoxHighlightedButton

highlight of DialogBoxHighlightedButton
This highlights the button in a Mac like way.

Setter
set the highlight of me
to NewValue

me (a DialogBoxHighlightedButton)
to

innerrect of DialogBoxHighlightedButton
This is the tag which points to the inner roundrect of this button. This inner button is
used for it's graphic appearance only.

Page 214
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n n e r r e c t o f D i a l o g B o x H i g h l i g h t e d B u t t o n

Getter
get the innerRect of me

Setter
set the innerrect of me
to NewValue

DialogBoxLabel
(a Label)

This is simply a label some graphic properties set to make it look nice.

See Also
DialogBox

directionalConnector
(an Arrow, Connector)

Connectors set up directional connections. The DirectionalConnector, a child of Connector is


especially suited to make such directional connections evident graphically.
For this purpose, it has the following properties:
(1) it is a child of Arrow and its endArrow is set to True so that the arrow points in the direction of the
connection.
(2) its endGeometry and startGeometry are set to 'projectCenter ': this ensures the arrows are
visible.

See Also
The Connector handlers startActor and endActor, the Actor handlers connectedTo and
connectedFrom and the Arrow handler endArrow.

Page 215
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d i r e c t o r y o f D i r e c t o r y E r r o r

DirectoryError
(a FileSystemError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

Properties of DirectoryError

directory of DirectoryError
The directory ID which caused the error (?)

Getter
get the directory of me

Setter
set the directory of me
to NewValue

DirectoryNickname
(an Object)

A DirectoryNickname object defines a translation from a logical host to a physical host for File objects.
Each DirectoryNickname object has:
a logicalName property, a string, naming the logical host
a physicalName virtual property, also a string, naming the physical host.
Each is readable and settable.
SK8 comes with two DirectoryNicknames of note:
SK8DirectoryNickname translating from "SK8" to the directory that the SK8 program is in.
RootDirectoryNickname translating from "Root" to the desktop folder.

Page 216
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l o g i c a l n a m e o f D i r e c t o r y N i c k n a m e

Properties of DirectoryNickname

logicalname of DirectoryNickname
Returns or can be set to any logical name (a string). This makes the DirectoryNickname
object associate its physicalName to this logicalName.

Getter
get the logicalName of me

Setter
set the logicalname of me
to NewValue

me (a DirectoryNickname)
to

physicalname of DirectoryNickname

Getter
get the physicalName of me

me (a DirectoryNickname)

Setter
set the physicalname of me
to NewValue

me (a DirectoryNickname)
to

DiskError
(a FileSystemError)

Page 217
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d i s k o f D i s k E r r o r

See Also
The Condition System section of the User Guide's SK8Script Language chapter

Properties of DiskError

disk of DiskError

Getter
get the disk of me

Setter
set the disk of me
to NewValue

DisplayErrorMessage
(a ConditionResponse)

Invoking this response displays a description of the current error in a modal dialog box, and then aborts
from the error.
It is always invokable.

See Also
messageToUser, ConditionResponse , the Condition System section of the User Guide's SK8Script
Language chapter

Handlers of DisplayErrorMessage

invoke of DisplayErrorMessage
invoke me

Page 218
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w r i t e O b j e c t o f D i s p l a y E r r o r M e s s a g e

Displays a description of the current error in a modal dialog box, and then aborts from the
error.

me (a DisplayErrorMessage)

See Also

messageToUser, abortError, ConditionResponse

writeObject of DisplayErrorMessage
writeObject me, thestream, rereadably
If rereadably is True , this just does the inherited writeObject behavior. Otherwise it
writes a description of what the DisplayErrorMessage response will do when invoked.

me (a DisplayErrorMessage)
thestream
rereadably

See Also

ConditionResponse , writeObject of Object

DivisionByZeroError
(an ArithmeticError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

Handlers of DivisionByZeroError

writeobject of DivisionByZeroError
writeObject me, thestream, rereadably

Page 219
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a c t o r To D r a w o f D r a w To o l

me (a DivisionByZeroError)
thestream
rereadably

DrawTool
(a Rectangle)

This is a rectangle which is designed to be placed in a DrawToolPalette and allows the user to draw
any SK8 actor. It has three local properties. First is actorToDraw, which specifies which actor the tool
will create when used. Second is styleToDraw which specifies which getShapeFromUser style will
be used when drawing. Finally there is a property multipleDraw which can be set to True or False
to say whether or not to allow the option (when the option key is depressed while drawing) to draw a
grid of actors

See Also
selected , deselected

Properties of DrawTool

actorToDraw of DrawTool
Specifies which actor the DrawTool will create when used.

Getter
get the actorToDraw of me

Setter
set the actortodraw of me
to NewValue

See Also

DrawTool , getShapeFromUser

Page 220
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m u l t i p l e D r a w o f D r a w To o l

multipleDraw of DrawTool
Can be set to True or False to say whether or not to allow the option (when the option
key is depressed while drawing) to draw a grid of objects.

Getter
get the multipleDraw of me

Setter
set the multipledraw of me
to NewValue

See Also

DrawTool , getShapeFromUser

styleToDraw of DrawTool
Specifies which getShapeFromUser style will be used when drawing.

Getter
get the styleToDraw of me

Setter
set the styletodraw of me
to NewValue

See Also

DrawTool , getShapeFromUser

Handlers of DrawTool

deselected of DrawTool
deselected me
This handler is called whenever the DrawTool is deselected. By default it sets the
framecolor to uirectangleoutbevel .

Page 221
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d o u b l e c l i c k o f D r a w To o l

me (a DrawTool)

doubleclick of DrawTool
doubleClick me
This causes a dialog to appear which asks the user to "Enter an Actor To Draw:". If the
reply is a bonafide actor, then set it sets my actorToDraw to that actor.

me (a DrawTool)

drawwith of DrawTool
drawWith me
with starth
with startv
with container
with project
Handle the user drawing the new actor, including setting its boundsrect , container
and project . It is best to call this in the mousedown of the area on which the actor is to
be drawn.

me (a DrawTool)
[with starth]: StartH and StartV which default to the current mouseloc of the
stage, specify in physical coordinates where the drawing is to begin.
[with startv]: StartH and StartV which default to the current mouseloc of the
stage, specify in physical coordinates where the drawing is to begin.
[with container]: This specifies the container to create the actors in. By
default it is placed in the container under the StartH, StartV location.
[with project]: This specifies in which project the objects are created. By
default, it uses the project of the "Container"

mousedown of DrawTool
mouseDown me
If the drawtool is contained by a drawToolPalette , it causes the tool to be selected .

me (a DrawTool)

selected of DrawTool
selected me

Page 222
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c u r r e n t t o o l o f D r a w To o l P a l e t t e

This handler is called whenever the DrawTool is selected. By default it sets the
framecolor to uirectangleinbevel .

me (a DrawTool)

DrawToolPalette
(a Rectangle)

This is a rectangle which knows how to work with the drawtool objects and the selectiontool
objects. When any drawtools or selectiontools are placed in it, and when the mouse is pressed on them,
the tools get a selected message sent to them which by default highlights them. When another tool is
selected, the last selected tool gets a deselected message to it which unhighlights it. The property
CurrentTool tracks the currently selected tool.

Properties of DrawToolPalette

currenttool of DrawToolPalette
The property CurrentTool tracks the currently selected drawtool or selectionTool
which is contained by the DrawToolPalette .

Getter
get the currentTool of me

Setter
set the currenttool of me
to NewValue

me (a DrawToolPalette)
to

Page 223
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a f fi x e d s c r o l l e r s o f E d i t Te x t

EditMenu
(a Menu)

The "Edit" menu provided as part of the SimpleMenubar. Provides copy/cut/paste and clear
functionality to the keytarget of the active window.

EditText
(an EditTextCollection, Rectangle)

While all actors support text display, only EditText actors allow the user to directly enter text inside the
actor. The user can position the cursor inside an EditText actor, and edit text through the keyboard or by
cutting, copying, or pasting. EditText supports all available fonts and font styles, as well as scrolling and
word wrap-around.

Properties of EditText

affixedscrollers of EditText
This property returns all the scrollers that are affixed to the editText. When a scroller is
affixed to an editText, it stays physically "stuck" to the EditText's side. A vertical scroller
snaps to the right side and a horizontal scroller snaps to the bottom.
This property is set by the set partnerScroller handler, and thus should not be set
directly.

Getter
get the affixedScrollers of me

me (an EditText)

Setter
set the affixedscrollers of me
to NewValue

Page 224
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h i g h l i g h t c o l o r o f E d i t Te x t

me (an EditText)
to: A list of scrollers or False (if no scrollers are affixed).

See Also

set partnerScroller.

highlightcolor of EditText
Specifies the color that us used to highlight the text that is selected. Should be an
RGBColor.

Getter
get the highlightColor of me

me (a EditText)

Setter
set the highlightcolor of me
to NewValue

me (a EditText)
to (an RGBColor)

horizontalscroll of EditText

Getter
get the horizontalScroll of me

Returns the number of pixels that the text in the EditText is currently scrolled by.

me (an EditText)

Setter
set the horizontalscroll of me
to NewValue

Sets the number of pixels that the text will be scrolled by horizontally (to the right).

Page 225
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
j u s t i fi c a t i o n o f E d i t Te x t

me (an EditText)
to (an Integer)

justification of EditText
Specifies the justification of the EditText. Three options are supported: 'left' , 'right'
and 'center' .

Getter
get the justification of me

me (an EditText)

Setter
set the justification of me
to NewValue

me (an EditText)
to: One of 'left' , 'right' or 'center' .

leftmargin of EditText
Specifies the number of pixels to leave blank at both sides of the EditText. The defaults is 4.

Getter
get the leftmargin of me

me (an EditText)

Setter
set the leftmargin of me
to NewValue

me (an EditText)
to (an Integer): The size in pixels of the right and left margins.

partnerhscroller of EditText
The companion horizontal scroller associated with the EditText.

Page 226
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p a r t n e r s c r o l l e r o f E d i t Te x t

Getter
get the partnerHScroller of me

Setter
set the partnerhscroller of me
with affixing
to NewValue

Sets the EditText actor's partner horizontal Scroller. This is done by setting the
PartnerScroller with the orientation set to 'horizontal' .

me (an EditText)
[with affixing] (a boolean): If True , the scroller is added to the
affixedScrollers of the EditText.
to: A scroller or False which disconnects the EditText from its present
partner horizontal scroller if any.

See Also

set partnerScroller.

partnerscroller of EditText
EditText actors are designed to work with optional horizontal or vertical scrollers.
The partnerScroller property stores scrollers partnered to the EditText. Once
partnered by setting this property, the scroller and the actor will work together: the
scroller can be used to scroll the text in the EditText. If there are no partnered Scrollers,
the partnerScroller property returns False .

Getter
get the partnerScroller of me orientation

me (an EditText)
orientation: 'vertical' or 'horizontal' .

Setter
set the partnerscroller of me
with affixing
with orientation
to NewValue

This handler partners a scroller to an EditText. Once partnered, the scroller can be used to
scroll the text in the Edittext. The scroller and the EditText are connected using ports. The

Page 227
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p a r t n e r v s c r o l l e r o f E d i t Te x t

properties concerned are the verticalScroll of the EditText (for vertical scrollers) and
the currentValue of the Scroller.

me (an EditText)
[with affixing] (a boolean): If True , the Scroller becomes affixed to the
EditText: it becomes a member of the affixedScrollers .
[with orientation]: 'horizontal' or 'vertical' (the default). Specifies
whether the scroller to be partnered will control horizontal or vertical
scrolling.
to: A scroller or False . If False , the current partnered scroller of the
orientation specified is disconnected from the EditText.

See Also

affixedScrollers and set partnerScroller of Picker for an illustration of how


the partnership is actually done.

partnervscroller of EditText
The companion vertical scroller associated with the EditText.

Getter
get the partnerVScroller of me

me (an EditText)

Setter
set the partnervscroller of me
with affixing
to NewValue

Sets the EditText actor's partner vertical Scroller. This is done by setting the
PartnerScroller with the orientation set to 'vertical' .

me (an EditText)
[with affixing] (a boolean): If True , the scroller will be added to the
affixedScrollers of the EditText.
to: A Scroller or False which disconnects the EditText from its present
vertical scroller if any.

See Also

set partnerScroller.

Page 228
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e l e c t e d i t e m s o f E d i t Te x t

selecteditems of EditText
This property specifies the text that is currently selected in the field.

Getter
get the selectedItems of me

me (an EditText)

Setter
set the selecteditems of me
to NewValue

Replaces the selected text with the string provided in the to argument.

me (an EditText)
to (a String)

Example
Here is a way this handler could be implemented.
on selectedItems of me (an EditText)
set {start,end} to my selection
return my text with start start with end end
end selectedItems

See Also

selection .

selection of EditText
Returns the position of the first and last characters selected in the editText. If nothing is
selected, the both values will be the position of the cursor.

Getter
get the selection of me

me (a EditText)

Page 229
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t a b l e n g t h o f E d i t Te x t

Setter
set the selection of me
to NewValue

Calls setSelection to do the work.

me (a EditText)
to: A list of two positive integers indicating the start and end of the selection.

See Also

setSelection , selectedItems .

tablength of EditText
Controls the size (in number of spaces) of all tabs in the EditText.

Getter
get the tablength of me

me (an EditText)

Setter
set the tablength of me
to NewValue

me (an EditText)
to (an Integer): The number of spaces a tab should be.

Text of EditText
This property specifies the text in the editText.

Getter
get the Text of me
with start
with end

Returns the text in the EditText between positions start and end. If these arguments are
not specified, all the text in the field is returned.

Page 230
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t e x t f o n t o f E d i t Te x t

me (an EditText)
[with start] (an Integer)
[with end] (an Integer)

Setter
set the text of me
with start
with end
with undo
to NewValue

Sets the text in the field between positions start and end to the text specified. If the start
and end arguments are not provided, the text supplied replaces the text proviously in the
field.

me (an EditText)
[with start] (an Integer)
[with end] (an Integer)
[with undo] (a boolean): If True , the change is undoable. Defaults to False .
to (a String)

textfont of EditText
This property lets you specify the font to use all or parts of the field's text.

Getter
get the textFont of me
with start
with end

Returns the font used to draw the text that starts at the position specified by the start
argument.

me (an EditText)
[with start] (an Integer)
[with end] (an Integer)

Page 231
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t e x t s i z e o f E d i t Te x t

Setter
set the textfont of me
with start
with end
to NewValue

Specifies the font to be used to draw the text between the character at position start and
the character at position end . If start and end are not specified, the font is applied to all
the text in the field.

me (an EditText)
[with start] (an Integer)
[with end] (an Integer)
to (a Font): The font's name as a string is also accepted.

textsize of EditText
This property lets you specify the text size of all or parts of the field's text.

Getter
get the textSize of me
with start
with end

Returns the font size used to draw the text that starts at the position specified by the
start argument.

me (an EditText)
[with start] (an Integer)
[with end] (an Integer)

Setter
set the textsize of me
with start
with end
to NewValue

Specifies the font size to be used to draw the text between the character at position start
and the character at position end. If start and end are not specified, the size is applied to
all the text in the field.

Page 232
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t e x t s t y l e o f E d i t Te x t

me (an EditText)
[with start] (an Integer)
[with end] (an Integer)
to

textstyle of EditText
This property lets you specify the text styles used to draw all or parts of the field's text.

Getter
get the textStyle of me
with start
with end

Returns the font style used to draw the text that starts at the position specified by the
start argument. Returns a list of styles.

me (an EditText)
[with start] (an Integer)
[with end] (an Integer)

Setter
set the textstyle of me
with start
with end
to NewValue

Specifies the text style to be used to draw the text between the character at position start
and the character at position end . If start and end are not specified, the style is applied to
all the text in the field.

me (an EditText)
[with start] (an Integer)
[with end] (an Integer)
to: A list of styles.

Page 233
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
v e r t i c a l s c r o l l o f E d i t Te x t

verticalscroll of EditText

Getter
get the verticalScroll of me
with byline

Returns the number of the first line visible in the EditText. If the byLine argument is
False , this handler returns the position of the first character visible in the field. The
byLine argument defaults to True .

This is the property onto which ports are attached to partner the field with a scroller.

Note: If any form of wrapping is on, computing the number of the first line currently
visible can be very expensive.◆

me (an EditText)
[with byline] (a boolean)

Setter
set the verticalscroll of me
to NewValue

Scrolls the text in the EditText so that the first line visible is the line whose number is
specified in the to argument.

me (an EditText)
to (an Integer): The line number of the line that will become the first line
visible in the field.

See Also

lineNumber.

wrapping of EditText
Controls the word wrap mode the editText is using. The options are:
False : no word wrap is in effect. User has to insert carriage returns to move to new lines.

'character' : wraps automatically when the end of the line is reached. Splits at last
character.
'word' : wraps automatically when the end of the line is reached. Only splits at the ends
of words.

Page 234
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a c t i v a t e t e x t o f E d i t Te x t

Getter
get the wrapping of me

me (an EditText)

Setter
set the wrapping of me
to NewValue

me (an EditText)
to: False , 'character' or 'word' .

Handlers of EditText

activatetext of EditText
activateText me
This handler prepares the EditText for text entering using the keyboard and other
operations using the mouse. Nothing happens if the EditText is lockedText .

me (an EditText)

See Also

lockedText , keyTarget .

active of EditText
active me
Returns whether the EditText is currently active: it is the keyTarget of its window and it
has received an activateText message. If True you can change the text by direct
manipulation.

me (an EditText)

See Also

activateText , deactivateText and keyTarget .

Page 235
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a c t o r Te x t S i z e o f E d i t Te x t

actorTextSize of EditText
actorTextSize me
with thetext
This handler returns the size the EditText would need to have in order to show all its
text .

If the field's wrapping is not False (it is either 'word' or 'character' ), this handler
will return the width of the field unchanged. In this case, a call to this handler is
interpreted as asking "given the current width, how high should this field be to show all
its text?"
If the field's wrapping is False , this handler returns the width and height required to
show all the text .

me (a EditText)

Example
Here is an EditText that makes sure to be of the right size to show all its text whenever the
its text gets set.
new EditText with objectName "NothingToHide"
We redefine set text to get the right things to happen...
on (set text) of me (a NothingToHide) to newValue
-- actually change the text.
do inherited
-- now resize it to show all its text.
set my size to my actorTextSize
end set text

autokey of EditText
autoKey me, key
Calls keyDown .

me (an EditText)
key (a Character)

See Also

keyDown .

clearselection of EditText
clearSelection me

Page 236
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o p y s e l e c t i o n t o c l i p b o a r d o f E d i t Te x t

Clears the selected text.

me (an EditText)

copyselectiontoclipboard of EditText
copySelectionToClipBoard me
Copies to the clipboard the text that is currently selected in the EditText.

me (an EditText)

See Also

addToClipboard , selectedItems .

cutselectiontoclipboard of EditText
cutSelectionToClipBoard me
Copies the selected text to the clipboard and removes it from the text of the EditText.

me (an EditText)

Example
Here is the handler in SK8Script. We get the string, add it to the clipboard and then clear
the selection.
on cutSelectionToClipboard of me (an EditText)
-- get the text
set {start, end} to my selection
set theText to my text with start start with end end
-- clear the text.
set my text with start start with end end to ""
-- add the string to the clipboard without copying.
addToClipboard sk8Clipboard, theText without copy
end cutSelectionToClipboard

See Also

addToClipboard .

deactivatetext of EditText
deactivateText me

Page 237
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e n t e r i n fi e l d o f E d i t Te x t

Deactivates the field no longer allowing you to enter text and use the mouse on the text.
This handler is called when the EditText ceases to be the keyTarget of its window.

me (an EditText)

See Also

keyTarget .

enterinfield of EditText
enterInField me
Called when the key entered is the enter key. The default handler passes the enter key to
handleKey.

me (an EditText)

See Also

handleKey.

enteringstage of EditText
enteringStage me
Performs the internal set up required to allow the field to draw directly to the screen.

me (an EditText)

forceredraw of EditText
forceRedraw me
with forceredraw
with updatescrollers
Forces an immediate redraw of the field and its contents.

me (an EditText)
[with forceredraw] (a boolean): If True , the field's text is completely
redrawn.
[with updatescrollers] (a boolean): If True , the scrollers are updated and
redrawn as well.

Page 238
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h a n d l e k e y o f E d i t Te x t

handlekey of EditText
handleKey me, key
Adds the key to the EditText's text and causes a redraw to happen (so that you see the
new key).

me (an EditText)
key

See Also

keyDown .

idle of EditText
idle me
Flashes the caret.

me (an EditText)

See Also

wantsIdle of Actor.

initialize of EditText
initialize me, original, isnew, args
The initialize handler copies the partner scrollers of the original and partners them to the
EditText.

me (an EditText)
original
child
args

See Also

partnerScroller.

keydown of EditText
keyDown me, key
Called when the EditText is the keyTarget of its window and the user enters the key.
This handler calls returnInField , enterInField or tabInField if the character is

Page 239
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l i n e n u m b e r o f E d i t Te x t

one of these three. Otherwise, handleKey gets called to add the character to the field's
text.

me (an EditText)
key (a Character)

See Also

keyup , handleKey, returnInField , tabInField , enterInField .

linenumber of EditText
linenumber me, position
Returns the line number of the line in which the position specified occurs. To jump to a
line once we know its number, use the verticalScroll property.

me (a EditText)
position (an Integer)

See Also

verticalScroll .

lockedtext of EditText
lockedText me
Returns whether the text of the EditText is locked. This is the case whenever the
lockTextLevel property is not False .

To lock the EditText call the lockText handler.

me (an EditText)

See Also

lockText , unlockText , lockTextLevel .

locktext of EditText
lockText me
Increments the lockTextLevel of the EditText by 1. Once locked, the EditText's text
cannot be changed by direct manipulation and it will be unresponsive to the mouse.

Page 240
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a k e fi l l r e g i o n o f E d i t Te x t

me (an EditText)

See Also

unlockText , lockTextLevel , activateText , deactivateText .

makefillregion of EditText
makeFillRegion me
Computes the fillRegion of the EditText.

me (an EditText)

mousedown of EditText
mouseDown me
If the EditText is locked, it propagates the event to its container. Otherwise it lets you
scroll and select text by dragging the mouse.

me (an EditText)

mouseenter of EditText
mouseEnter me
Sets the cursor of the Stage to the IBeamCursor to indicate that text editing is
available. Does nothing if the EditText is locked.

me (an EditText)

See Also

cursor of the Stage .

mouseleave of EditText
mouseLeave me
Sets the cursor of the Stage to the StandardCursor.

me (an EditText)

Page 241
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p a s t e c l i p b o a r d t o s e l e c t i o n o f E d i t Te x t

See Also

cursor of the Stage .

pasteclipboardtoselection of EditText
pasteClipBoardToSelection me
Replaces the current selectedItems with the text in the clipboard.

me (an EditText)

See Also

getFromClipboard , selectedItems .

pointonwhichpart of EditText
pointOnWhichPart me, h, v
with part
If the part argument is 'char' , the character at the position specified by h and v is
returned. If it is 'line' the line number of the line at the coordinates specified is
returned. Otherwise the inherited (Actor) handler is called.

me (an EditText)
h (an Integer): The horizontal location of interest in Stage coordinates.
v (an Integer): The vertical location of interest in Stage coordinates.
[with part]: 'char' , 'line' or the usual Actor options.

See Also

pointOnWhichPart of Actor.

preserve of EditText
preserve me
Gets called when SK8 is being saved as an application. Does some internal clean ups.
Note: Do the inherited handler if you redefine this handler.◆

me (an EditText)

restore of EditText
restore me

Page 242
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e t u r n i n fi e l d o f E d i t Te x t

Called when the object must be restored from its disk format to its memory format when
SK8 loads. The editText handler does some internal set up.
Note: If you redefine this handler for a child of EditText, you should do the inherited
handler.◆

me (an EditText)

returninfield of EditText
returnInField me
Called when the key entered is the return key. The default handler passes the return key
to handleKey so that the carriage return is added to the text.

me (an EditText)

See Also

handleKey.

selectall of EditText
selectAll me
Selects all the text in the EditText.

me (an EditText)

setselection of EditText
setSelection me, start, end
Selects all characters between the characters at position start and end. If start is -1 we
select from the first character in the EditText to end. If end is -1, we select to the last
character in the EditText.

me (an EditText)
start (an Integer): The position of the first characted to be part of the
selection.
end: The position of the last characted to be part of the selection.

See Also

selection , selectedItems .

Page 243
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s h o w s e l e c t i o n o f E d i t Te x t

showselection of EditText
showSelection me
with index
Scrolls the text in the EditText to ensure the selected text is visible.

me (an EditText)
[with index] (an Integer): If specified, this handler will scroll to show the
character at this position instead of showing the selection.

See Also

selection , verticalScroll .

size of EditText
size me
with physical
with how
Returns or specifies the size of the EditText. The getter has extra options to find the size in
characters or lines. The setter only lets you change the size in the Actor sense.

See Also

size of Actor.

tabinfield of EditText
tabInField me
If the EditText's autotab is True , calls tabToNextActor. Otherwise just passes the tab
key to handleKey so that it is entered in the text.

me (an EditText)

See Also

handleKey, tabToNextActor and autotab .

undo of EditText
undo me
Undoes the last change done to the text by direct manipulation.

me (an EditText)

Page 244
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
u n l o c k t e x t o f E d i t Te x t

unlocktext of EditText
unlockText me
with force
Decreases the lockTextLevel of the EditText by 1. If it becomes 0 we set it to False and
the EditText gets activated, meaning that the text can be altered directly with the keyboard
and the mouse.

me (an EditText)
[with force] (a boolean): If True , the lockTextLevel is taken to 0 forcing
the field to activate.

See Also

lockText , lockTextLevel , activateText .

updatepartnerscroller of EditText
updatePartnerScroller me, thescroller
with force
This handler is called whenever the text or the scroll of the EditText changes, to update the
scrollers. The default handler resets all the scroller values that need to be reset.

me (an EditText)
thescroller (a Scroller): The scroller to be updated. Usually this scroller has
already been partnered to the EditText.
[with force] (a boolean): If True , the update will happen immediately.
Defaults to False , letting the system update the scroller when time is
available.

visiblelines of EditText
visibleLines me
Returns the number of lines that are currently visible in the EditText.
Note: This handler does NOT return the number of lines visible in general. This is
impossible since the font can change arbitrarily.◆

me (an EditText)

wordundermouse of EditText
wordUnderMouse me

Page 245
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e m p t y o f E d i t Te x t C o l l e c t i o n

Returns the word under the mouse if any (the mouse has to be within the bounds of the
field and over a word).

me (an EditText)

EditTextCollection
(a Text)

Handlers of EditTextCollection

empty of EditTextCollection
empty me
empty returns True if the EditTextCollection is empty; otherwise, False .

me (an EditTextCollection)

text for mods of EditTextCollection


text for mods me
with start
with end

me (an EditTextCollection)
[with start]
[with end]

Effect
(an Object)

The parent object of a variety of media objects which may be used to moduluate the appearance (e.g., the
colors) or behaviours (e.g., Bouncing) of Graphic objects.

Page 246
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t e x t f o r m o d s o f E d i t Te x t C o l l e c t i o n

EmptyAppleScriptResult
(an Object)

The object returned when an AppleScript has no result. This is to avoid confounding the cases of an
AppleScript returning False and returning no value.

Example
The following lines will return the EmptyAppleScriptResult object:
new AppleScript with objectname "ASExample" with scripttext "Beep"
execute ASExample

See Also
AppleScript

EndOfFileError
(a FileError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

EnumeratedType
(a VirtualType)

This is a VirtualType that is satisfied by any object that is the same object as one of the objects in
the options property.

Page 247
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o p t i o n s o f E n u m e r a t e d Ty p e

Properties of EnumeratedType

options of EnumeratedType
This property holds an arbitrary list of objects; EnumeratedType 's typeSatisfied
returns True if the given object is the same object as any one of the objects in its
options.

Getter
get the options of me

Setter
set the options of me
to NewValue

Handlers of EnumeratedType

typeSatisfied of EnumeratedType
typesatisfied me, obj
Returns True if the given object is the same object as any one of the objects in its
options property.

me (an EnumeratedType)
object

Error
(a Condition)

The parent object of all error warning objects


supplies an errorID property

Page 248
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e r r o r I D o f E r r o r

See Also
The Condition System section of the User Guide's SK8Script Language chapter

Properties of Error

errorID of Error

Getter
get the errorID of me

Setter
set the errorid of me
to NewValue

Handlers of Error

writeObject of Error
writeObject me, thestream, rereadably

me (an Error)
thestream
rereadably

ErrorColor
(an ImageRenderer)

This renderer is used by the system to render a mask whenever an error occur with the current renderer.
The most common renderer errors have to do with the renderer's media being False .
The errorColor depicts an eared Mac that has fallen down and crashed hurting itself badly.

Page 249
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a c t i v a t e o f E v e n t M o d e

EventMode
(an Object)

Event modes allow you to circumvent normal event processsing so that you can perform critical
operations without disruptions caused by unanticipated processing of other events.
Note: Refer to the Event Modes section in the SK8 Use Guide.◆

Handlers of EventMode

activate of EventMode
activate me
activate is sent only when the event mode is first entered.
You should specialize this handler if you have to
initialize your event mode.
Note: Also see:
resume and suspend◆

me (an EventMode)

deactivate of EventMode
deactivate me
deactivate is sent only when the event mode is finally exited
by a call to exitMode.
Note: See also:
resume and suspend◆

me (an EventMode)

entermodalstate of EventMode
enterModalState me
enterModalState is called by you to enter your event mode, but in such a manner than no
system events are generated by SK8. This is useful to, e.g., create modal dialogs or

Page 250
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e n t e r m o d e o f E v e n t M o d e

windows or uninterruptible processes. exitMode will always be called when your event
mode terminates. You exit a modal state by calling the exitModalState function.
enterModalState calls enterMode.

me (an EventMode)

entermode of EventMode
enterMode me
entermode, along with exitmode, still exists, but is no longer specializable. These handlers
are locked.

me (an EventMode)

eventtick of EventMode
eventTick me
The default behavior for an eventTick on me (a eventMode) is to do nothing.

me (an EventMode)

exitmode of EventMode
exitMode me
exitmode, along with entermode, still exists, but is no longer specializable. These
handlers are locked

me (an EventMode)

handleactivate of EventMode
handleActivate me
Activate the window that the event was meant for.

me (an EventMode)

handleautokey of EventMode
handleAutoKey me

Page 251
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h a n d l e i d l e o f E v e n t M o d e

send the auto-key event to the window specified by the event

me (an EventMode)

handleidle of EventMode
handleIdle me
send a nul event to the window specified by the event

me (an EventMode)

handlekeydown of EventMode
handleKeyDown me
send a keydown event to the window where the keydown event happened

me (an EventMode)

handlekeyup of EventMode
handleKeyUp me
send a keyup event to the window where the keyup event happened

me (an EventMode)

handlemousedown of EventMode
handleMouseDown me

me (an EventMode)

handlemouseup of EventMode
handleMouseUp me

me (an EventMode)

handleother of EventMode
handleOther me

Page 252
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h a n d l e u p d a t e o f E v e n t M o d e

Beep and display an error meassage:


"BUG: A spurious event happened!"
" Please send a bug report. The SK8 Team"

me (an EventMode)

handleupdate of EventMode
handleUpdate me
send a update event to the window where the update event happened

me (an EventMode)

resume of EventMode
resume me
resume is called by SK8 on System object immediately after SK8 resumes operation after
being suspended by an external process.
In particular, this event is sent to the System object, whenever the user switches back into
SK8 from another application (such as the Finder). The default resume handler checks the
system environment for possible changes.
This event is sent to the event mode object when the event mode is "re-entered" when it
has already been active but temporarily superseded by another one. Typically, you won't
have to specialize this.

me (an EventMode)

Example
resume System
resume orchestrator

See Also

See suspend

suspend of EventMode
suspend me
The suspend event is sent to an EventMode whenever that event mode is suspended.

Page 253
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
E v e n t M o d e o f E v e n t M o d e E r r o r

me (an EventMode)

Example
suspend System

See Also

See resume

EventModeError
(a ProgrammaticError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

Properties of EventModeError

EventMode of EventModeError

Getter
get the EventMode of me

Setter
set the eventmode of me
to NewValue

Page 254
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w r i t e o b j e c t o f E v e n t M o d e E r r o r

Handlers of EventModeError

writeobject of EventModeError
writeObject me, thestream, rereadably

me (an EventModeError)
thestream
rereadably

ExitModeWithError
(a ConditionResponse)

Invoking this response exits the current event mode and reraises the current error.
It is invokable if there is currently an event mode active.

See Also
EventMode , ConditionResponse , the Condition System section of the User Guide's SK8Script
Language chapter

Handlers of ExitModeWithError

invokable of ExitModeWithError
invokable me
Returns True if there is currently an event mode active.

me (an ExitModeWithError)

See Also

EventMode , currentEventModes , ConditionResponse

Page 255
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n v o k e o f E x i t M o d e W i t h E r r o r

invoke of ExitModeWithError
invoke me
Exits the current event mode and reraises the current error.

me (an ExitModeWithError)

See Also

ConditionResponse , currentEventModes

writeObject of ExitModeWithError
writeObject me, thestream, rereadably
If rereadably is True , this just does the inherited writeObject behavior.
Otherwise, if the response is invokable, it writes a description of what the
ExitModeWithError response will do when invoked. If the response is not invokable, it
writes an explanation of why it is not.

me (an ExitModeWithError)
thestream
rereadably

See Also

ConditionResponse , writeObject of Object

File
(a FileName)

The File object is a child of the FileName object. It exists only for backward compatability and at some
point will be removed.

See Also
FileName .

Page 256
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
fi l e d i r e c t o r y o f F i l e

Properties of File

filedirectory of File

Getter
get the filedirectory of me

Returns the directory portion of the the File (logical or physical as set) as a string.

Returns False if the File has no name.

me (a File)

Setter
set the filedirectory of me
to NewValue

Sets the directory portion of the File to a string.

me (a File)
to

See Also

fileType , fileDevice .

filetype of File

Getter
get the fileType of me

Returns the type of a File as a string.

Some file system implementations support file types, or extensions as they are sometimes
called, seperate from the file name. Other implementations simply include the type with
the name, syntactically seperated with a period. VMS is an example of the former, the
Macintosh and Unix are examples of the latter.

Page 257
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l o g i c a l n a m e o f F i l e

me (a File)

Setter
set the filetype of me
to NewValue

Sets the type of the File to the given string.

me (a File)
to

Example
set myFile to a new File with logicalname
"SK8;directory:thisfile.text"
Returns: the File "SK8;directory:thisfile.text"
get the fileType of myFile
Returns: "text"

logicalname of File

Getter
get the logicalName of me

Returns the logical name of the File a string, or False if the File has no name.

The setter sets the logical name of a Pathname to a string. The string must be a
syntactically valid logical pathname appropriate to the storage device and operating
system or else an error will be signaled.

For the Macintosh, the syntax for a Logical File Name is as follows:

"LogicalHost;Directory:Directory:Name"

me (a File)

Setter
set the logicalname of me
to NewValue

Page 258
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a c F i l e C r e a t o r o f F i l e

me (a File)
to

Example
set the logicalName of myfile to "SK8;mydirectory:foo"
Returns: "SK8;mydirectory:foo"
get the logicalName of myfile
Returns: "SK8;mydirectory:foo"

See Also

name , physicalName .

macFileCreator of File

Getter
get the macfilecreator of me

Returns the Macintosh file creator of the file referenced by the File object as a string of four
characters.

Directories don't have Macintosh file creators, so if the file is a directory, the symbol
'directory' is returned.

If the file is an alias to a file that no longer exists, the symbol 'danglingAlias' is returned.

me (a File)

Setter
set the macfilecreator of me
to NewValue

Sets the Macintosh file creator of the file referenced by the File object to a string of four
characters.

me (a File)
to

Page 259
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a c fi l e t y p e o f F i l e

See Also

macFileType .

macfiletype of File

Getter
get the macFileType of me

Returns the Macintosh file type of the file referenced by the File object as a string of four
characters.

Directories don't have Macintosh file types, so if the file is a directory, the symbol
'directory' is returned.

If the file is an alias to a file that no longer exists, the symbol 'danglingAlias' is returned.

Note: The macFileType handler is not to be confused with fileType handler, which returns
a field from the File object.◆

me (a File)

Setter
set the macfiletype of me
to NewValue

Sets the Macintosh file type of the file referenced by the File object to a string of four
characters.

me (a File)
to

See Also

fileType , macFileCreator.

name of File

Getter
get the name of me
with directory

Page 260
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o s p a t h n a m e o f F i l e

Returns the name of a File as a string, or False if the File has no name.

The exact syntax of the name is dependant on the platform's operating system

and whether the File reference is logical or physical.

The Directory keyword (getter function only) allows you to specify whether the name is
returned as just the name portion of the File, or the full name inluding the directory. The
Directory keyword defaults to True .

me (a File)
[with directory]

Setter
set the name of me
to NewValue

me (a File)
to

Example
set myFile to a new File with logicalName "sk8;myfile"
--> the File "sk8;myfile"
get the name of myFile
--> "sk8;myfile"
get the name of myFile with directory false
--> "myfile"
set the name of myFile "thisfile"
--> "thisfile"
get the name of myFile
--> "sk8;thisfile"
get the name of myFile with directory false
--> "thisfile"

See Also

logicalName, PhysicalName

ospathname of File

Getter
get the osPathname of me

Page 261
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p h y s i c a l n a m e o f F i l e

Setter
set the ospathname of me
to NewValue

physicalname of File

Getter
get the physicalName of me
with directory

Returns the physical name of the File as a string, or False if the File has no name. If the
File has a logical name, a logical-to-physical conversion will be performed so that the
physical name can be returned.

me (a File)
[with directory]

Setter
set the physicalname of me
to NewValue

The setter sets the physical name of a File to the given string. The string must be a
syntactically valid physical name appropriate to the storage device and operating system
or else an error will be signaled.

For the Macintosh, the physical name syntax looks like this:

"device:directory:name"

There may be zero or more directories.

me (a File)
to

Example
set myfile to a new file with logicalname "SK8;directory:foo"
--> the File "SK8;directory:foo"

get the physicalName of myfile


--> "Harumph:SK8 1.0d4:directory:foo"

Page 262
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c r e a t e fi l e o f F i l e

See Also

logicalName, name

Handlers of File

createfile of File
createFile me
Creates a new file (physically, on the disk) from the given File object.
An error is signaled if the file cannot be created due to inappropriate name, nonexistant
folder, the file already exists, etc.

me (a File)

See Also

duplicate, move, deleteFile

creationdate of File
creationDate me
Returns a Date object representing the date and time that the file specified by the given
File object was created.
The creation date is not settable (it is set when the file is created).

me (a File)

See Also

modificationDate

delete of File
delete me
Physically deletes the file specified by the File object.

me (a File)

Page 263
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d i r e c t o r i e s o f F i l e

See Also

createFile, duplicate, move

directories of File
directories me
If File is a folder, directories returns all the directories in the folder as a list of File objects.
Otherwise, it returns False .

me (a File)

See Also

Files

directory of File
directory me
Returns the containing directory (a File object) of the File.
If the argument is a directory, we go one level up.
If the argument is the RootDirectory, return False .

me (a File)

Example
set myfile to a new file with logicalName "sk8;mydirectory:myfile"
--> the File "sk8;mydirectory:myfile"
get the directory of myfile
--> the File "sk8;mydirectory:"

directorynames of File
directoryNames me
If File is a folder, directories returns the names of all the directories in the folder as a list of
strings. Otherwise, it returns False .
The list of strings has a lower overhead than the list of File objects that the directories
handler returns.

me (a File)

Page 264
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
fi l e d e v i c e o f F i l e

See Also

directories

filedevice of File
fileDevice me
Returns the StorageDevice object associated with the File.

me (a File)

fileexists of File
fileExists me
Returns True if the given File object physically exists on the disk, or False if it does not.

me (a File)

See Also

directoryExists

filenames of File
fileNames me
with directories
If the given File is a folder, the fileNames handler returns the names of all the files in that
folder as a list of strings. Otherwise, it returns False .
The list of strings has a lower overhead than the list of File objects that the files handler
returns.

me (a File)
[with directories]

files of File
files me
with directories
If the given File is a folder, the files handler returns all the files in the folder as a list of File
objects.
Otherwise, it returns False .

Page 265
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i s d i r e c t o r y o f F i l e

Note: See also:


directories◆

me (a File)
[with directories]

See Also

fileNames

isdirectory of File
isDirectory me
Returns True if the given File object names a directory that exists on disk. Otherwise
returns False .

me (a File)

See Also

fileExists

isRootDirectory of File
isRootDirectory me
Returns True if this File names the RootDirectory. Otherwise False .

me (a File)

macCountResourcesOfType of File
macCountResourcesOfType me, resType
Returns the number of resources of the specified type in the file referenced by the given
File object.

me (a File)
restype

See Also

macHasResources , macResourceTypesAvailable ,
macSK8ImportableResourceTypesAvailable , macGetResourceHandles ,
macGetResourceHandleInfo , macGetResourceHandleNames ,

Page 266
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a c G e t R e s o u r c e F r o m Ty p e A n d I n d e x o f F i l e

macGetResourceHandleIds , macTotalSK8ImportableResources ,
macGetResourceHandleFromIdForDrawing , macGetResourceHandleFromId ,
macGetResourceHandleFromName , getResourceHandleFromTypeAndIndex ,
macResourceFileOpen , macUpdateResourceFile .

macGetResourceFromTypeAndIndex of File
macGetResourceFromTypeAndIndex me, resType, index
Given a resource type and an index, for a resource of me (a File), return a handle for that
resource.
Note: See "Inside Macintosh" for information on the get1IndResource function.◆

me (a File)
restype
index

See Also

macHasResources , macResourceTypesAvailable ,
macSK8ImportableResourceTypesAvailable , macGetResourceHandles ,
macGetResourceHandleInfo , macGetResourceHandleNames ,
macGetResourceHandleIds , macTotalSK8ImportableResources ,
macGetResourceHandleFromIdForDrawing , macGetResourceHandleFromId ,
macGetResourceHandleFromName , macResourceFileOpen ,
macCountResourcesOfType , macUpdateResourceFile .

macGetResourceHandleFromId of File
macGetResourceHandleFromId me, resType, resid
Given a resource type and a resource ID, for a resource of me (a File), returns a handle to
that resource.
Note: See "Inside Macintosh" for information on the getNamedResource function◆

me (a File)
restype
resid

See Also

macHasResources , macResourceTypesAvailable ,
macSK8ImportableResourceTypesAvailable , macGetResourceHandles ,
macGetResourceHandleInfo , macGetResourceHandleNames ,
macGetResourceHandleIds , macTotalSK8ImportableResources ,
macGetResourceHandleFromIdForDrawing , macGetResourceHandleFromName ,

Page 267
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a c G e t R e s o u r c e H a n d l e F r o m I d F o r D r a w i n g o f F i l e

getResourceHandleFromTypeAndIndex , macResourceFileOpen ,
macCountResourcesOfType , macUpdateResourceFile .

macGetResourceHandleFromIdForDrawing of File
macGetResourceHandleFromIdForDrawing me, resType, resid
Given a restype and a resourceId, returns the handle in a safe form for drawing.
Note: Should be used by machandle.◆

me (a File)
restype
resid

See Also

macHasResources , macResourceTypesAvailable ,
macSK8ImportableResourceTypesAvailable , macGetResourceHandles ,
macGetResourceHandleInfo , macGetResourceHandleNames ,
macGetResourceHandleIds , macTotalSK8ImportableResources ,
macGetResourceHandleFromId , macGetResourceHandleFromName ,
getResourceHandleFromTypeAndIndex , macResourceFileOpen ,
macCountResourcesOfType , macUpdateResourceFile .

macGetResourceHandleFromName of File
macGetResourceHandleFromName me, resType, resname
Given a restype and a name, for a resource of me (a File), returns the handle.
Note: See "Inside Macintosh" for information on the get1IndResource function.◆

me (a File)
restype
resname

See Also

macHasResources , macResourceTypesAvailable ,
macSK8ImportableResourceTypesAvailable , macGetResourceHandles ,
macGetResourceHandleInfo , macGetResourceHandleNames ,
macGetResourceHandleIds , macTotalSK8ImportableResources ,
macGetResourceHandleFromIdForDrawing , macGetResourceHandleFromId ,
getResourceHandleFromTypeAndIndex , macResourceFileOpen ,
macCountResourcesOfType , macUpdateResourceFile .

Page 268
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a c G e t R e s o u r c e H a n d l e I d s o f F i l e

macGetResourceHandleIds of File
macGetResourceHandleIds me, resType
Given a resource type, return a list of resource ID's for all the resources of that type in me
(a File).

me (a File)
restype

See Also

macHasResources , macResourceTypesAvailable ,
macSK8ImportableResourceTypesAvailable , macGetResourceHandles ,
macGetResourceHandleInfo , macGetResourceHandleNames ,
macTotalSK8ImportableResources ,
macGetResourceHandleFromIdForDrawing , macGetResourceHandleFromId ,
macGetResourceHandleFromName , getResourceHandleFromTypeAndIndex ,
macResourceFileOpen , macCountResourcesOfType , macUpdateResourceFile .

macGetResourceHandleInfo of File
macGetResourceHandleInfo me, resType
Given a resource type return a list of resource names and their ids, for resources of me (a
File) that match that type.

me (a File)
restype

See Also

macHasResources , macResourceTypesAvailable ,
macSK8ImportableResourceTypesAvailable , macGetResourceHandles ,
macGetResourceHandleNames , macGetResourceHandleIds ,
macTotalSK8ImportableResources ,
macGetResourceHandleFromIdForDrawing , macGetResourceHandleFromId ,
macGetResourceHandleFromName , getResourceHandleFromTypeAndIndex ,
macResourceFileOpen , macCountResourcesOfType , macUpdateResourceFile .

macGetResourceHandleNames of File
macGetResourceHandleNames me, resType
Given a resource type return a list of resource names, for resources of me (a File) that
match that type.

Page 269
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a c G e t R e s o u r c e H a n d l e s o f F i l e

me (a File)
restype

See Also

macHasResources , macResourceTypesAvailable ,
macSK8ImportableResourceTypesAvailable , macGetResourceHandles ,
macGetResourceHandleInfo , macGetResourceHandleIds ,
macTotalSK8ImportableResources ,
macGetResourceHandleFromIdForDrawing , macGetResourceHandleFromId ,
macGetResourceHandleFromName , getResourceHandleFromTypeAndIndex ,
macResourceFileOpen , macCountResourcesOfType , macUpdateResourceFile .

macGetResourceHandles of File
macGetResourceHandles me, resType
Returns alist of the handles of all resources of the file referenced by the given File object
that are of the type specificied.

me (a File)
restype

See Also

macHasResources , macResourceTypesAvailable ,
macSK8ImportableResourceTypesAvailable , macGetResourceHandleInfo ,
macGetResourceHandleNames , macGetResourceHandleIds ,
macTotalSK8ImportableResources ,
macGetResourceHandleFromIdForDrawing , macGetResourceHandleFromId ,
macGetResourceHandleFromName , getResourceHandleFromTypeAndIndex ,
macResourceFileOpen , macCountResourcesOfType , macUpdateResourceFile .

macHasResources of File
macHasResources me
Returns True if the file referenced by the File object has a resource fork.
Otherwise returns False .

me (a File)

Page 270
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a c R e s o u r c e F i l e O p e n o f F i l e

See Also

macResourceTypesAvailable , macSK8ImportableResourceTypesAvailable ,
macGetResourceHandles , macGetResourceHandleInfo ,
macGetResourceHandleNames , macGetResourceHandleIds ,
macTotalSK8ImportableResources ,
macGetResourceHandleFromIdForDrawing , macGetResourceHandleFromId ,
macGetResourceHandleFromName , getResourceHandleFromTypeAndIndex ,
macResourceFileOpen , macCountResourcesOfType , macUpdateResourceFile .

macResourceFileOpen of File
macResourceFileOpen me
Returns True if the resource file is open.

me (a File)

See Also

macHasResources , macResourceTypesAvailable ,
macSK8ImportableResourceTypesAvailable , macGetResourceHandles ,
macGetResourceHandleInfo , macGetResourceHandleNames ,
macGetResourceHandleIds , macTotalSK8ImportableResources ,
macGetResourceHandleFromIdForDrawing , macGetResourceHandleFromId ,
macGetResourceHandleFromName , getResourceHandleFromTypeAndIndex ,
macCountResourcesOfType , macUpdateResourceFile .

macResourceTypesAvailable of File
macResourceTypesAvailable me
Returns a list of all resource types available in the file referenced by the give File object as
a list of strings.

me (a File)

See Also

macHasResources , macSK8ImportableResourceTypesAvailable ,
macGetResourceHandles , macGetResourceHandleInfo ,
macGetResourceHandleNames , macGetResourceHandleIds ,
macTotalSK8ImportableResources ,
macGetResourceHandleFromIdForDrawing , macGetResourceHandleFromId ,
macGetResourceHandleFromName , getResourceHandleFromTypeAndIndex ,
macResourceFileOpen , macCountResourcesOfType , macUpdateResourceFile .

Page 271
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a c S K 8 I m p o r t a b l e R e s o u r c e Ty p e s Av a i l a b l e o f F i l e

macSK8ImportableResourceTypesAvailable of File
macSK8ImportableResourceTypesAvailable me
Returns True if any of the resources in the file referenced by the given File object can be
imported into SK8.

me (a File)

See Also

macHasResources , macResourceTypesAvailable , macGetResourceHandles ,


macGetResourceHandleInfo , macGetResourceHandleNames ,
macGetResourceHandleIds , macTotalSK8ImportableResources ,
macGetResourceHandleFromIdForDrawing , macGetResourceHandleFromId ,
macGetResourceHandleFromName , getResourceHandleFromTypeAndIndex ,
macResourceFileOpen , macCountResourcesOfType , macUpdateResourceFile .

macTotalSK8ImportableResources of File
macTotalSK8ImportableResources me
Returns the number of resources in the file referenced by the given File object that can be
imported into SK8.

me (a File)

See Also

macHasResources , macResourceTypesAvailable ,
macSK8ImportableResourceTypesAvailable , macGetResourceHandles ,
macGetResourceHandleInfo , macGetResourceHandleNames ,
macGetResourceHandleIds , macGetResourceHandleFromIdForDrawing ,
macGetResourceHandleFromId , macGetResourceHandleFromName ,
getResourceHandleFromTypeAndIndex , macResourceFileOpen ,
macCountResourcesOfType , macUpdateResourceFile .

macUpdateResourceFile of File
macUpdateResourceFile me
Updates the resource map and resource data for the file specified by the given File object.
See Inside Macintosh for details.

me (a File)

Page 272
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o d i fi c a t i o n d a t e o f F i l e

See Also

macHasResources , macResourceTypesAvailable ,
macSK8ImportableResourceTypesAvailable , macGetResourceHandles ,
macGetResourceHandleInfo , macGetResourceHandleNames ,
macGetResourceHandleIds , macTotalSK8ImportableResources ,
macGetResourceHandleFromIdForDrawing , macGetResourceHandleFromId ,
macGetResourceHandleFromName , getResourceHandleFromTypeAndIndex ,
macResourceFileOpen , macCountResourcesOfType .

modificationdate of File
modificationDate me
Returns a Date object representing the date and time that the file specified by the given
File object was last modified. This is not settable (it is set when the file is modified).

me (a File)

See Also

creationDate

openproject of File
openProject me
with copyright
Loads a project from the stored project file referenced by the given File object.
Returns the Project.
If the copyright keyword is supplied, the string becomes the new copyright notice for the
project.

me (a File)
[with copyright]

FileChooser
(a Rectangle)

This is an object that allows you to select a file by navigating the Mac's file hierarchy.The fileChooser is a
rectangle with two things in it: a pop up menu and a textList that uses an icon picker as its picker. The

Page 273
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a c t i o n t e x t o f F i l e C h o o s e r

pop up menu shows the folders that contain the currentDirectory all the way to the Desktop. The picker
shows all the files in the currentDirectory. The fileChooser also includes two buttons: the "Open" and
"Desktop" buttons.
When the user doubleclicks on an item on the picker (or presses the "Open" button), the fileChooser's
fileAction handler is called. If the file selected is a directory, the currentDirectory is set to it (causing to
display in the picker the files in the new directory). If the file selected is not a directory, the outputFile
property of the fileChooser is set to the file.
To use this object as a component in a browser, just set up an output port on the outputFile property.

Properties of FileChooser

actiontext of FileChooser
Stores the string used as the text of the FileChooser's openButton when the selected file is
not a directory.
The selectionCompleted handler of the FileList's picker sets the text of the openButton to
this string when the items selected are not directories.

Getter
get the actiontext of me

Setter
set the actiontext of me
to NewValue

currentdirectory of FileChooser
This property stores the directory (a File) that we are currently browsing in the
FileChooser.

Getter
get the currentDirectory of me

Setter
set the currentdirectory of me
to NewValue

Page 274
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d e s k t o p b u t t o n o f F i l e C h o o s e r

Tells the FileChooser what directory to focus on. When this property is set, the
FileChooser's menu is rebuilt to show the path from the new directory to the Desktop.
Also the items in the FileChooser's fileList are recomputed and redisplayed.

me (a FileChooser)
to: A file representing the new directory.

desktopbutton of FileChooser
Returns the RoundRect used as the FileChooser's desktop button.
Note: This property is a tag.◆

Getter
get the deskTopButton of me

Setter
set the desktopbutton of me
to NewValue

disablefiles of FileChooser
If this property is True , all files are disabled (they are greyed out) in the FileChooser. This
is used when the FileChooser is needed to do a "Save As..." operation.

Getter
get the disableFiles of me

Setter
set the disablefiles of me
to NewValue

FileList of FileChooser
Returns the FileList that the FileChooser uses to display the files.
Note: This property is a tag.◆

Getter
get the FileList of me

Page 275
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a c fi l e t y p e o f F i l e C h o o s e r

Setter
set the filelist of me
to NewValue

macfiletype of FileChooser
If this property is not False , the FileChooser only displays files of the macFileType
specified.

Getter
get the macFileType of me

Setter
set the macfiletype of me
to NewValue

See Also

macFileType of file

Menu of FileChooser
Returns the menu the FileChooser uses to show the path to the root of the file hierarchy
(the Desktop).
Note: This property is a tag.◆

Getter
get the Menu of me

Setter
set the menu of me
to NewValue

openbutton of FileChooser
Returns the RoundRect the fileChooser uses as its open button.
Note: This property is a tag.◆

Getter
get the openButton of me

Page 276
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o u t p u t fi l e o f F i l e C h o o s e r

Setter
set the openbutton of me
to NewValue

outputfile of FileChooser
This property is set by the fileChooser when a file has been selected. We consider a file to
be selected either when it has been doubleclicked on or when it is selected and the return
key is pressed.
Setting the property does not do anything. It is available to be used as an input to a port.

Getter
get the outputFile of me

Setter
set the outputfile of me
to NewValue

Handlers of FileChooser

fileaction of FileChooser
fileAction me
This handler is called when the user doubleClicks on an item in the FileChooser's fileList,
or clicks on the openButton. If the selected item is a file, the output file of the FileChooser
is set to it. If it is a directory, the FileChooser's currentDirectory is set to it. In addition, the
openButton is highlighted to show what is going on.

me (a FileChooser)

See Also

outputFile and set currentDirectory

mouseenter of FileChooser
mouseEnter me
Sets the cursor of the Stage to the CursorPointing.

Page 277
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o u s e l e a v e o f F i l e C h o o s e r

me (a FileChooser)

See Also

cursor of the Stage

mouseleave of FileChooser
mouseLeave me
Sets the cursor of the Stage to the StandardCursor.

me (a FileChooser)

See Also

cursor of the Stage

resized of FileChooser
resized me
Sets the boundsRect of all its components to conform to the FileChooser's new size.

me (a FileChooser)

FileError
(a FileSystemError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

Page 278
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
F i l e o f F i l e E r r o r

Properties of FileError

File of FileError

Getter
get the File of me

Setter
set the file of me
to NewValue

FileList
(a TextList)

The text list component of fileChooser, where the files are listed.

See Also
FileChooser

FileMemoryFullError
(a MemoryFullError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

FileMenu
(a Menu)

Page 279
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
F i l e o f F i l e E r r o r

The File menu provided as part of the SimpleMenubar. It provides a "Close" menu item that closes the
active window and a "Quit" menu item which quits SK8.

FileName
(an Object)

The FileName object is used to represent the location of a file or a directory (whether the file actually
exists or not). A simple String could represent a file or directory location, but the FileName object has an
understanding of logical and physical names, directories and other parts of a file name and so forth,
independent of operating system specifics and syntax.
A fileName object has these virtual properties. Each can be accessed or set individually.
storageDevice The device the file is stored on.
directory A string describing the File's directory.
name File's name within that directory, a string.
type The File's type, a string.
macFileType (MacOS specific)
macFileCreator (MacOS specific)
There are two ways a File object can be be specified; physically or logically. A File object set with a
physicalName refers to the location of the file explicitly. For instance, this is a physicalname:
Barney:myDirectory:mySubDirectory:name.text
Logicalnames use the physicalName of a DirectoryNickname object at the top level, with a semicolon to
note that this is a Logicalname. For instance:
SK8;SubDirectory:SubSubDirectory:name.text
Children of the File object allow writing to and reading from the disk. File objects have properties that
allow disk access of resource forks, folders, and data forks.
Since Files and Streams are collections, all of their operations are available via path expressions. Read
and write operations are supported in ByteStreams and TextStreams via the collection protocol. This
allows one to read or write to a file from within a repeat loop or by using a complex path expression.

See Also
File (a FileName object)

Page 280
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w r i t e o b j e c t o f F i l e N o t F o u n d E r r o r

FileNotFoundError
(a FileError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

Handlers of FileNotFoundError

writeobject of FileNotFoundError
writeObject me, thestream, rereadably

me (a FileNotFoundError)
thestream
rereadably

FilePopUp
(a Menu)

The pop-up menu component of fileChooser.

Handlers of FilePopUp

makeMenu of FilePopUp
makeMenu me
Updates the menu to display all the files in the currentDirectory of its container.

me (a FilePopUp)

Page 281
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o u s e d o w n o f F i l e P o p U p

mousedown of FilePopUp
mouseDown me
Sets the defaultMenuItem of the menu to 1 and then does the inherited handler to pop
up the menu.

me (a FilePopUp)

See Also

defaultMenuItem of Menu .

FileSystemError
(an Error)

The parent object of File System error warnings.

See Also
The Condition System section of the User Guide's SK8Script Language chapter

Float
(a Real)

This object is the ancestor of all floating point numbers. Floating point numbers are further categorized
by SmallFloat and BigFloat .
Note: Floating point numbers, by default, are represented as BigFloat , but those within the
representation limits of SmallFloat can be coerced to its more compact representation (either at
runtime —e.g. 1.5 as a SmallFloat — or at compile time —e.g. the SmallFloat 1.5 ).◆

See Also
SmallFloat , BigFloat

Page 282
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
f o n t d a t a o f F o n t

Font
(a Media)

A child of Media representing a font in the system. You are guaranteed a Sk8 object for each font that
you have installed in your System Folder.
When SK8 is restored, all fonts that were present in the original environment and are not present in the
current one turn into Chicago. Fonts that are available now that were not available in the original
environment are created on the spot. Thus, if you ask for the fonts of the system you get the
knownChildren of font.
Fonts are named like their fonts when possible. Exceptions occur with Times which is called "TimesFont"
because "times" is a reserved word in SK8Script. Note also that fonts that start their names with a number
will be appended an "f" at the start. Thus a font called "1Times" would become an object called "f1Times".

See Also
the fonts of the System

Properties of Font

fontdata of Font
Returns the system number that corresponds to the font given.

Getter
get the fontData of me

Setter
set the fontdata of me
to NewValue

fontname of Font
Returns the name of the font as a string. The name of TimesFont, for example, is "Times".

Getter
get the fontName of me

Page 283
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t r a p a r g u m e n t s o f F o r e i g n D e f Tr a p

Setter
set the fontname of me
to NewValue

Sets the fontName of the font to the string specified. Recomputes the fontData.

me (a Font)
to

See Also

fontData

Handlers of Font

ForeignDeftrap
(an Object)

Properties of ForeignDeftrap

traparguments of ForeignDefTrap

Getter
get the trapArguments of me

Setter
set the traparguments of me
to NewValue

Page 284
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n i t i a l i z e f r o m s t o r e o f F o r e i g n D e f Tr a p

Handlers of ForeignDeftrap

initializefromstore of ForeignDefTrap
initializeFromStore me

me (a ForeignDeftrap)

registerastrap of ForeignDefTrap
registerAsTrap me

me (a ForeignDeftrap)

writeobject of ForeignDefTrap
writeObject me, str, rereadably

me (a ForeignDeftrap)
str
rereadably

ForeignMemory
(an Object)

ForeignMemory is the abstract class of both memPointer and memHandle. When you use foreign (native
operating system) memory, the SK8 memory system can do very little management or safety checking for
you. Using foreign memory is for very advanced users only. Please read the SK8 User Guide chapter
"SK8 Foreign Function and Data Interface" before atempting to use foreign memory as inappropriate use
can easily crash your machine.
ForeignMemory may be "owned" or "unowned" by SK8. When foreignMemory is owned by SK8 and is
no longer referenced, its deallocation handle, disposeMem, is invoked on it. By default memory
allocated via newMemHandle or newMemPointer is owned by SK8. Memory ownership can be changed
by functions memOwn and memDisown. When foreignMemory is not owned by SK8, the user must
explicitly deallocate it by calling foreign routines where defined (e.g. Macintosh Traps such as
DisposePointer, DisposeHandle, DisposeWindow, etc.). These functions may be invoked multiple times
on the same foreignMemory object without error. When SK8 owned foreignMemory objects are passed

Page 285
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w r i t e o b j e c t o f F o r e i g n D e f Tr a p

to disposeMem, the disposeMem handler for that type of memory is invoked. IF UNOWNED FOREIGN
MEMORY IS PASSED TO DISPOSEMEM NO ACTION OCCURS. You are not warned about this. If you
disown foreign memory, you are taking full responsibility for it.
Sometimes raw machine addresses or handles are passed back to SK8 as a result of foreign function calls.
As SK8 has no knowledge of such foreign entities, it can do no management or error checking. One can
make SK8 aware of them by explicitly telling SK8 what their storage "type" is. Note that SK8 trusts what
you tell it. If you lie to SK8, you can easily crash you machine. (This is technically known as "bad
karma"). You give SK8 information about a raw machine pointer or handle using the function
toMemHandle or toMemPointer. When you do this, you should drop any references the the raw
machine datum and use the memPointer or memHandle returned by the function you called to tell SK8
about it.
When a foreignMemory object is created, its contents are set to the value zero (0). You can add
initialization by defining a handler on the memory "type" via the handle initializeMem. You can define
cleanup actions via the handle disposeMem. Note that the disposeMem handle replaces the default
cleanup, so you must remember to either call the foreign deallocator (e.g. DisposeHandle,
DIsposePointer, or whatever you have defined) or be sure to "call next method" so that the default
default deallocator is invoked. Use disposeMem to dispose interior pointers or use non-default
deallocators (e.g. DisposeWindow for a handle created by a call to NewWindow).

See Also
newMemHandle , newMemPointer, disposeMem , memOwn , memDisown , toMemPointer,
toMemHandle , toSK8Mem , initializeMem , disposeMem , MemPointer, memHandle

Function
(an Object)

A Function is similar to a handler, in that it is a body of SK8Script commands that may be executed,
but it is different in that it is not associated with any particular object , rather it is associated with its
project .

As opposed to a handler, a function (1) does not require any arguments, and (2) does not have the
variables me and myself bound in the body of the script.

Example
A simple function might be defined like this (note that there is no object type information for n):
on add2 of n
return n + 2
end add2 of n
To see all of the functions which are defined in SK8, use this command:
get the functions of sk8

Page 286
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w r i t e o b j e c t o f F o r e i g n D e f Tr a p

See Also
handler, project , object

FunctionSheet
(a TextList)

This is a TextList whose PickerPrototype has been set to FunctionSheetPicker. Therefore it


provides a nice scrollable version of this browser component. Note that the TextList itself has none of
the browsing functionality, it's Picker does. Thus, whenever you wish to get at the browsing
functionality, you should access the object tagged as the Picker of this object.

Example
set the inputProject of the Picker of SuperCoolFunctionSheet to SK8

FunctionSheetPicker
(a ProjectDataSheetPicker)

This is a ProjectDataSheetPicker with it's properties set so it shows only functions.

GeneralError
(an Error)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

Page 287
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o b j e c t s o f G e n e r a l E r r o r

Properties of GeneralError

objects of GeneralError

Getter
get the objects of me

Setter
set the objects of me
to NewValue

strings of GeneralError

Getter
get the strings of me

Setter
set the strings of me
to NewValue

Handlers of GeneralError

writeobject of GeneralError
writeObject me, thestream, rereadably

me (a GeneralError)
thestream
rereadably

Page 288
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e n a b l e d o f G e t F r o m U s e r B u t t o n

GeneralProgrammaticError
(a ProgrammaticError, GeneralError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

GetFromUserButton
(a RoundRect)

The GetFromUserButton is a roundrect which has two input properties inputObjects and
inputProperty. These specify what property on which objects this button is editing. When pressed the
button allows the user to select a value for that property. That property is set to that value on all of the
objects.

See Also
enabled , mousedown , BrowserComponent , GetObjectField

Properties of GetFromUserButton

enabled of GetFromUserButton
Accepts or returns whether the GetFromUserButton is enabled. When enabled is set to
False , the button is grayed and is not selectable. Note this is set dynamically when
inputProperty and inputObjects are set.

Getter
get the enabled of me

Setter
set the enabled of me
to NewValue

Page 289
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n p u t O b j e c t s o f G e t F r o m U s e r B u t t o n

me (a GetFromUserButton)
to

inputObjects of GetFromUserButton
This can be set to a list of objects. It specifes the set of objects whose properties (specified
by the inputProperty ) will be set.

Getter
get the inputObjects of me

Setter
set the inputobjects of me
to NewValue

me (a GetFromUserButton)
to

inputProperty of GetFromUserButton
This can be set to a property name (e.g. 'fillcolor'). It specifes the property which is being
set.

Getter
get the inputProperty of me

Setter
set the inputproperty of me
to NewValue

me (a GetFromUserButton)
to

Page 290
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o u s e d o w n o f G e t F r o m U s e r B u t t o n

Handlers of GetFromUserButton

mousedown of GetFromUserButton
mouseDown me
This causes either a dialog or a menu to appear with the appropriate choices for that
property.

me (a GetFromUserButton)

GetObjectField
(a Rectangle, BrowserComponent)

This object is designed to allow the user to choose a single object of a single type. The type is defined by
the inputPrototype property. The user can choose an object by typing in the textfield , throught
the GetFromUserButton , or when and object is dropped on it. The object is put in the
GetFromUserButton property.

See Also
GetFromUserButton

Properties of GetObjectField

GetFromUserButton of GetObjectField
This tags the right side GetFromUserButton which brings up a set of choices for the
field.

Getter
get the GetFromUserButton of me

Page 291
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n p u t O b j e c t o f G e t O b j e c t F i e l d

Setter
set the getfromuserbutton of me
to NewValue

inputObject of GetObjectField
The object in the field can by specified programmatically with this property.

Getter
get the inputObject of me

Setter
set the inputobject of me
to NewValue

me (a GetObjectField)
to

inputPrototype of GetObjectField
This is the input property which specifies the type of the object this field can get. After
this is specified then the textfield will evaluate expressions only that return an object of
the specified type. Only objects of this type can be dropped into this object.

Getter
get the inputPrototype of me

Setter
set the inputprototype of me
to NewValue

me (a GetObjectField)
to

outputObject of GetObjectField
This is set when an object is dropped in the field, or the user enters an object in the field.

Getter
get the outputObject of me

Page 292
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t e a r o f f r e c t o f G e t O b j e c t F i e l d

Setter
set the outputobject of me
to NewValue

tearoffrect of GetObjectField
This tags the left side rectangle which is used for drag and drop.

Getter
get the tearOffRect of me

Setter
set the tearoffrect of me
to NewValue

textField of GetObjectField
This tags the textfield where the user can type an objectname or a SK8Script query.

Getter
get the TextField of me

Setter
set the textfield of me
to NewValue

Handlers of GetObjectField

dropped of GetObjectField
dropped me, droppee
Handle dropping ObjectDataRect whose object must be of the type specified by
InputPrototype onto me.

me (a GetObjectField)
droppee

Page 293
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d i r e c t i o n o f G r a d i e n t

Gradient
(a Renderer)

Renders a region with a color that smoothly goes from the start color to
the end color. Lets you specify the direction in which the color will be changing.

See Also
direction , scaleFactor, startRed , startGreen , startBlue , endRed , endGreen , endBlue .

Properties of Gradient

direction of Gradient
Determines in what form the color will change. Options are:
'vertical'
'horizontal'
'rect' : the frame of the region's rectangle is colored with the start color. The rectangle
will then get smaller and smaller towards the center of the region that will be colored with
the endcolor.
'oval' : like the one above but using an oval.

'shape' : also like above but using the shape of the region to be drawn.

Getter
get the direction of me

me (a Gradient)

Setter
set the direction of me
to NewValue

me (a Gradient)
to: One of 'vertical' , 'horizontal' , 'rect' , 'oval' and 'shape' .

Page 294
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e n d b l u e o f G r a d i e n t

endblue of Gradient
Specifies the blue component of the end RGB color. A number from 0 to 65535.

Getter
get the endBlue of me

me (a Gradient)

Setter
set the endblue of me
to NewValue

me (a Gradient)
to (an Integer)

endgreen of Gradient
Specifies the green component of the end RGB color. A number from 0 to 65535.

Getter
get the endGreen of me

me (a Gradient)

Setter
set the endgreen of me
to NewValue

me (a Gradient)
to (an Integer)

endred of Gradient
Specifies the red component of the end RGB color. A number from 0 to 65535.

Getter
get the endRed of me

me (a Gradient)

Page 295
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s c a l e f a c t o r o f G r a d i e n t

Setter
set the endred of me
to NewValue

me (a Gradient)
to (an Integer)

scalefactor of Gradient
Determines the number of steps to get to the end color from the start color. Only taken
into account when the direction is 'shape' , 'oval' or 'rect' .

Getter
get the scaleFactor of me

me (a Gradient)

Setter
set the scalefactor of me
to NewValue

me (a Gradient)
to (an Integer)

startblue of Gradient
Specifies the blue component of the start RGB color. A number from 0 to 65535.

Getter
get the startBlue of me

me (a Gradient)

Setter
set the startblue of me
to NewValue

me (a Gradient)
to (an Integer)

Page 296
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s t a r t g r e e n o f G r a d i e n t

startgreen of Gradient
Specifies the green component of the start RGB color. A number from 0 to 65535.

Getter
get the startGreen of me

me (a Gradient)

Setter
set the startgreen of me
to NewValue

me (a Gradient)
to (an Integer)

startred of Gradient
Specifies the red component of the start RGB color. A number from 0 to 65535.

Getter
get the startRed of me

me (a Gradient)

Setter
set the startred of me
to NewValue

me (a Gradient)
to (an Integer)

Handlers of Gradient

render of Gradient
render me, theactor, region, thepaper

Page 297
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e n d e r o f G r a d i e n t

Paints the region specified. Computes the number of different colors it can fit in the region
provided and then the amount to use to increment each RGB value. It then paints each
band, incrementing the start RGB until the end RGB values are reached.

me (a Gradient)
theactor (an Actor): The actor currently being drawn.
region (a Mask): The region to be painted.
thePaper: The surface on which the drawing takes place. This argument
should be passed "as is" to other render handlers and some handlers
defined on the Pen and Mask objects.

Graphic
(an Object)

Graphic are objects which have direct manifestations on a screen. Graphic has only three children:
Actor, MenuItem and the Stage .

See Also
Actor, MenuItem and the Stage .

halo
(an Actor)

The Halo is an actor with special geometry which make it look like a rectangular frame. It is a rectangle
with a rectangular hole cut from its center. Note that a halo has no frame, therefore it's framecolor will
never be rendered and it's framesize will be ignored.

Example
One use of this object is as a frame around another rectangle. The same functionality could be gotten by
a rectangle with a fillcolor of transparent and a framesize of the inset size, but the halo is more efficient
and can be put on the stage.

See Also
surroundObject

Page 298
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n s e t S i z e o f H a l o

Properties of halo

insetSize of Halo
The insetSize is the size of the Halo's “frame.” The coordinates specify the horizontal and
vertical sizes, respectively.

Getter
get the insetSize of me

Setter
set the insetsize of me
to NewValue

Example
get the insetSize of Halo
set the insetSize of Halo to {h,v}

Handlers of halo

makeBoundsRegion of Halo
makeBoundsRegion me
Computes the Halo's boundsRegion . This is done by creating a rectangular region equal
in size to the halo's boundsRect , then computing a region equal to the “hole” in the halo.
This is done by inseting the original rectangle by the number of pixels specified in the
insetSize . Then you subtract the hole from the rectangle, and you get the Halo's
boundsRegion .

me (a Halo)

Example
makeBoundsRegion Halo

Page 299
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a k e F i l l R e g i o n o f H a l o

makeFillRegion of Halo
makeFillRegion me
Computes the fillRegion , in this case by copying the boundsRegion .
Note: See also: makeBoundsRegion◆

me (a Halo)

Example
makeFillRegion Halo

makeFrameRegion of Halo
makeFrameRegion me
The Halo's frameRegion is always empty. Note that this means that the Halo's framecolor
will never be rendered.

me (a Halo)

Example
makeFrameRegion Halo

surroundobject of Halo
surroundObject me, actortosurround
with outset
When this handler is called, it has the halo directly surround the actor specified in the
second argument. It works on the physical boundsrect of the halo, so it does not matter
if the halo and the actor to be surrounded are in different containers. If False is specifed
as the second argument, the halo is moved offstage.

me (a Halo)
actortosurround: This is the actor which the halo will frame.

Handler
(an Object)

Page 300
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o m p o n e n t f r o m o f H a n d l e r D a t a R e c t

A handler in SK8 is similar to a verb in the real world. The behavior of objects and operations on
objects are performed by handlers. A Handler is a named piece of code that is executed in response to a
message or event. Handlers are procedures available to an object taht specify some action to be
performed.
Handlers are inherited just like properties. An object inherits all the handlers defined on each of its
ancestors.
You can't really do a whole lot with the actual handler class. More important are its descendants, which
are handlers for objects.
The handlers of an object may be found by useing a handler called handler.

See Also
Function

HandlerDataRect
(a Rectangle)

This rectangle along with the ObjectDataRect and the PropertyDataRect are the objects used to
provide drag and drop functionality between the various components. This one provides a place to
drag a single handler which has been defined on one or more objects.

See Also
Handler, Objects

Properties of HandlerDataRect

componentfrom of HandlerDataRect
This is set to the component from which the object is being dragged. This can be used by
components to prevent objects being dropped on themselves.

Getter
get the componentFrom of me

Page 301
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
H a n d l e r o f H a n d l e r D a t a R e c t

Setter
set the componentfrom of me
to NewValue

Handler of HandlerDataRect
This property specifies the name of the handler being dragged.

Getter
get the Handler of me

Setter
set the handler of me
to NewValue

objects of HandlerDataRect
This property specifies the object or set of objects whose handler is being dragged.

Getter
get the objects of me

Setter
set the objects of me
to NewValue

HandlerList
(a TextList)

This is a TextList whose PickerPrototype has been set to HandlerPicker. Therefore it provides a
nice scrollable version of this browser component. Note that the TextList itself has none of the
browsing functionality, it's Picker does. Thus, whenever you wish to get at the browsing functionality,
you should access the object tagged as the Picker of this object.

Example
set the inputObjects of the Picker of SuperCoolHandlerList to {rectangle,
oval, roundrect}

Page 302
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o b j e c t s o f H a n d l e r D a t a R e c t

HandlerPicker
(a PropertyHandlerPicker)

This is a PropertyHandlerPicker with it's properties set so it shows only handlers.


This is simply a PropertyHandlerPicker set up to show only handlers.

HandlerSheet
(a TextList)

This is a TextList whose PickerPrototype has been set to HandlerSheetPicker. Therefore it


provides a nice scrollable version of this browser component. Note that the TextList itself has none of
the browsing functionality, it's Picker does. Thus, whenever you wish to get at the browsing
functionality, you should access the object tagged as the Picker of this object.

Example
set the inputObjects of the Picker of SuperCoolHandlerSheet to {rectangle,
oval, roundrect}

HandlerSheetPicker
(a PropertyHandlerSheetPicker)

This is a PropertyHandlerSheetPicker with it's properties set so it shows only handlers.

HandlerViewer
(a TextList)

This is a TextList whose PickerPrototype has been set to HandlerViewerText . Therefore it


provides a nice scrollable version of this browser component. Note that the TextList itself has none of
the browsing functionality, it's Picker does. Thus, whenever you wish to get at the browsing
functionality, you should access the object tagged as the Picker of this object.

Page 303
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n p u t h a n d l e r o f H a n d l e r Vi e w e r Te x t

Example
set the inputObjects of the Picker of SuperCool<recordObject> to item 1 in the
localhandlers of actor

HandlerViewerText
(a ScriptEditText, BrowserComponent)

This component is designed for displaying the text of a single existing handler. It does not allow editing
of this text. If the text is not available, it shows other information, such as the argument list.
It has a property inputHandler which can be set to a single handler object or False . This specifies
what handler is being viewed.

Properties of HandlerViewerText

inputhandler of HandlerViewerText
This property specifies which handler's text will be displayed.

Setter
set the inputhandler of me
to NewValue

me (a HandlerViewerText)
to

HandlerWatchingComponent
(a Rectangle, BrowserComponent)

HandlerWatchingComponent is a browser component that can be hooked up to one or more handler/


function objects, and allows you to modify any of the watching options (i.e. those that appear on the
"Watching" menu in the ScriptEditorWindow) as well as the breakpoints status for all of those handler/

Page 304
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n p u t h a n d l e r s o f
H a n d l e r Wa t c h i n g C o m p o n e n t

function objects at once. Each checkbox controls one of the watching options, and the pushbutton
deactivates all active breakpoints (if there are any).

Properties of HandlerWatchingComponent

inputhandlers of HandlerWatchingComponent
This property holds the collection of handler objects on which the component operates.

Getter
get the inputHandlers of me

Setter
set the inputhandlers of me
to NewValue

Changes the set of handlers which the component will affect.

me (a HandlerWatchingComponent)
to: The new collection of handler objects upon which the component will
operate

Handlers of HandlerWatchingComponent

Hatch
(a Renderer)

Hatch renderers render the region provided with a background renderer (the backGroundRenderer )
and then draw repeating paralel lines over it setting the pen's color to the foreGroundRenderer
(which must be an RGBColor ). Note that there are no restrictions on the type of the
backgroundRenderer.

Page 305
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b a c k g r o u n d r e n d e r e r o f H a t c h

You use the hatchType property to specify whether the lines will be horizontal or vertical paralel lines
(set is to 'horizontal' , 'vertical' or 'both' ). You can also specify the thickness of each line by
setting the penSize which should be a list of 2 integers. Finally, you use the spacing property to
specify the separation between lines and the startAt property to determine where the first line will be
drawn.

See Also
backGroundRenderer, foreGroundRenderer, hatchType , penSize , spacing and startAt .

Properties of Hatch

backgroundrenderer of Hatch
Specifies the renderer used to render the background.

Getter
get the backgroundRenderer of me

me (a Hatch)

Setter
set the backgroundrenderer of me
to NewValue

me (a Hatch)
to (a Renderer)

foregroundrenderer of Hatch
Specifies the color to use to draw the lines. Should be an RGBColor.

Getter
get the foregroundRenderer of me

me (a Hatch)

Page 306
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h a t c h t y p e o f H a t c h

Setter
set the foregroundrenderer of me
to NewValue

me (a Hatch)
to (an RGBColor)

hatchtype of Hatch
Specifies the direction in which the lines get drawn. There are three options:
'horizontal' : horizontal lines are drawn.

'vertical' : vertical lines are drawn.

'both' : both of the above resulting in a grid.

Getter
get the hatchType of me

me (a Hatch)

Setter
set the hatchtype of me
to NewValue

me (a Hatch)
to: One of 'horizontal' , 'vertical' or 'both' .

pensize of Hatch
A list of two integers, specifying the pen size to be used for drawing the lines.

Getter
get the penSize of me

me (a Hatch)

Setter
set the pensize of me
to NewValue

Page 307
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s p a c i n g o f H a t c h

me (a Hatch)
to: The pensize as a list of the form {hSize, vSize} .

spacing of Hatch
An integer specifying the number of pixels between each two lines.

Getter
get the spacing of me

me (a Hatch)

Setter
set the spacing of me
to NewValue

me (a Hatch)
to (an Integer)

startat of Hatch
An integer specifying the number of pixels from the top (or left) at which to start drawing.
Defaults to False , meaning that the lines will start at the edge of the region to be covered.

Getter
get the startAt of me

me (a Hatch)

Setter
set the startat of me
to NewValue

me (a Hatch)
to: An integer or False .

Page 308
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e n d e r o f H a t c h

Handlers of Hatch

render of Hatch
render me, theactor, region, thepaper
First renders the backgroundRenderer, then draws the lines over it.

me (a Hatch)
theactor (an Actor): The actor currently being drawn.
region (a Mask): The region to be painted.
thePaper: The surface on which the drawing takes place. This argument
should be passed "as is" to other render handlers and some handlers
defined on the Pen and Mask objects.

Translucent of Hatch
Translucent me
Returns True if the backGroundRenderer is translucent .

me (a Hatch)

See Also

translucent of Renderer, backgroundRenderer.

HierarchicalObjectList
(a TextList)

This is a TextList whose PickerPrototype has been set to HierarchicalObjectPicker.


Therefore it provides a nice scrollable version of this browser component. Note that the TextList itself
has none of the browsing functionality, it's Picker does. Thus, whenever you wish to get at the
browsing functionality, you should access the object tagged as the Picker of this object.

Example
set the inputObjects of the Picker of SuperCoolHierarchicalObjectList to
{rectangle, oval, roundrect}

Page 309
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
fi l t e r p r o j e c t o f H i e r a r c h i c a l O b j e c t P i c k e r

HierarchicalObjectPicker
(a HierarchicalPicker, MixinForObjectPickers)

This is a HierarchicalPicker with a MixinForObjectPickers added as a parent. Setting the


inputObjects sets the top level set of objects that are shown. This picker can be used to browse in a
"finder-style" manner a specified property relation .

See Also
swatchesShown , itemContents , HierarchicalPickerItem

Properties of HierarchicalObjectPicker

filterproject of HierarchicalObjectPicker
If specified, this browser will only show objects which are visible to the specified
project .

Getter
get the filterProject of me

Setter
set the filterproject of me
to NewValue

relation of HierarchicalObjectPicker
This specifies the property which is being browsed. For example, if the picker were
displaying the contents of the stage, then this property should be set to 'contents'. This
would cause finder style triangles to appear for items which have contents. Clicking on
these triangles will access the value in the contents property of the object and display
them hierarchically.

Getter
get the relation of me

Page 310
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s w a t c h e s s h o w n o f H i e r a r c h i c a l O b j e c t P i c k e r

Setter
set the relation of me
to NewValue

swatchesshown of HierarchicalObjectPicker
The hierarchical object picker can display iconic swatches between the arrows and the
item's text. If this property is set to true, when the items property is set and
generateItems is called, the handler createSwatch is called to generate the set of
renderers to use as these swatches.

Getter
get the swatchesShown of me

Setter
set the swatchesshown of me
to NewValue

See Also

createIcon

Handlers of HierarchicalObjectPicker

createSwatch of HierarchicalObjectPicker
createswatch me, theitem
This handler is called by generateItems when the swatchesShown property is set to
true. This handler should return a renderer to use a swatch next to the text of the item.

me (a HierarchicalObjectPicker)
theitem

See Also

To take snapshots of actors, see capturePicture of imageRenderer. createIcon

itemContents of HierarchicalObjectPicker
itemContents me, theitem

Page 311
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o f f s e t o f H i e r a r c h i c a l P i c k e r

Get the property of the theItem, defined by the relation, and return it as a
hierarchicalPickerItem .

me (a HierarchicalObjectPicker)
theitem

HierarchicalPicker
(an IconTextPicker)

This is a picker which gives "Finder-style" hierarchical browsing functionality. It allows the user to have
a picker with little arrows on the left hand side which can be clicked on to toggle between showing and
hiding additional information (i.e. other items). Each item can have an icon associated with it that is
drawn just to the left of the text (e.g. in the finder there are tiny folder and file icons to the left of the text).
The items of this picker must always be set to a list of HierachicalPickerItem s which provide all
the necessary information to the picker as to the icons, text, and offsets that should be used. The handler
GenerateItems can be used to quickly create these items.

See Also
offset , closeItem , openItem , itemContents

Properties of HierarchicalPicker

offset of HierarchicalPicker
This property specifies the degree of horizontal offset each level of the hierarchy is given.
In other words, this is the number of pixels which is offset for each level of the depth of
the item.

Getter
get the offset of me

Setter
set the offset of me
to NewValue

Page 312
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c l o s e I t e m o f H i e r a r c h i c a l P i c k e r

Handlers of HierarchicalPicker

closeItem of HierarchicalPicker
closeItem me, theitem
This handler is called when the arrow is clicked on to close up an item. By default, this
finds all the items below it that are deeper and removes them from the items.

me (a HierarchicalPicker)
theitem

createTextDisplayItem of HierarchicalPicker
createTextDisplayItem me, theitem
This makes sure that the Value of the item is used to generate the strings. Remember the
value property of a hierarchicalPickerItem stores the piece of data in the
HierarchicalPicker.

generateItems of HierarchicalPicker
generateItems me, itemlist
By default this handler takes a list of items as a second argument. The handler generates a
set of corresponding HierarchicalPickerItems. So if you wish to set the items of a
hierarchicalPicker to the knownchildren of rgbcolor, then you should call:
set the items of the superPicker to generateitems(superPicker,
the knownchildren of rgbcolor)

me (a HierarchicalPicker)
itemlist

itemContents of HierarchicalPicker
itemContents me, theitem
This handler is called by OpenItem when the user clicks on arrow to open up an item.
This handler is passed the item clicked on as the second argument. The value of this item
should be used to generate and return the set of hierarchicalPicker items which are
below the current item in the hierarchy.

Page 313
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o u s e d o w n o f H i e r a r c h i c a l P i c k e r

me (a HierarchicalPicker)
theitem

mousedown of HierarchicalPicker
mouseDown me
This checks where the user clicked on the picker, and if it was on an arrow, opens or closes
the item as appropriate.

me (a HierarchicalPicker)

mouseup of HierarchicalPicker
mouseUp me
This checks where the user clicked on the picker, and if it was on an arrow, ensures a click
or double click is not sent. This is simply so clicking on an arrow does not affect the
selection as it has special meaning.

me (a HierarchicalPicker)

openItem of HierarchicalPicker
openItem me, theitem
This handler is called when the arrow is clicked on to open up an item. By default, this
calls itemContents on the picker with the item to get the set of items which are revealed
(e.g. the folder's contents). It then splices these items into the picker just below the
opened item and sets the depth of the item.
Remember, use itemContents to generate the set of items that appear when an item is
opened. You should only redefine this handler with great care.

me (a HierarchicalPicker)
theitem

HierarchicalPickerItem
(an Object)

Page 314
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d e p t h o f H i e r a r c h i c a l P i c k e r I t e m

Because every item in the hierarchical picker can be either open or closed and have a swatch or not, this
object serves a way to encapsulate that information. You can only set the items of a hierarchical picker to
a list of these objects. See HierarchicalPicker for more information on how to create these items
dynamically.

See Also
depth , state , swatch , value

Properties of HierarchicalPickerItem

depth of HierarchicalPickerItem
This property can be set to an integer and it determines how many levels deep this item
is. This property is used to calculate the horizontal offset of the text of the item.

Getter
get the depth of me

Setter
set the depth of me
to NewValue

state of HierarchicalPickerItem
The state of a hierarchicalPickerItem is either false, 'closed' or 'open' corresponding
to no arrow, a closed arrow or an open arrow respectively.

Getter
get the state of me

Setter
set the state of me
to NewValue

swatch of HierarchicalPickerItem
This property specifies if a swatch is to be drawn next to the arrow. This property can be
set to a renderer or false.

Page 315
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
v a l u e o f H i e r a r c h i c a l P i c k e r I t e m

Getter
get the swatch of me

Setter
set the swatch of me
to NewValue

value of HierarchicalPickerItem
This property specifies the actual object which is the value of this item.

Getter
get the value of me

Setter
set the value of me
to NewValue

Highlighted
(a Renderer)

This is a renderer which paints the object in the system's highlight color. Note that this renderer is
translucent .

Handlers of Highlighted

render of Highlighted
render me, theactor, region, thepaper
This paints the object in the system's highlight color.

Page 316
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
Tr a n s l u c e n t o f H i g h l i g h t e d

me (a Highlighted)
theActor
region
thePaper: The surface on which the drawing takes place. This argument
should be passed "as is" to other render handlers and some handlers
defined on the Pen and Mask objects.

Translucent of Highlighted
Translucent me
This returns true to show that this renderer is, in fact, translucent.

me (a Highlighted)

IconRSRC
(a Media)

Parent object of color icon ("cicn") resources. Icons can be displayed by making them the media of an
imageRenderer.

See Also
ImageRenderer.

Handlers of IconRSRC

boundsrect of IconRSRC
boundsRect me
Returns the physical rectangle that encloses the image stored in this media object.

me (an IconRSRC)

Page 317
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d e f a u l t r e n d e r s t y l e o f I c o n R S R C

defaultrenderstyle of IconRSRC
defaultRenderStyle me
Returns the way in which a media of this type is commonly rendered. For the IconRSRC,
this handler returns 'renderStretched' .

me (an IconRSRC)

displaysample of IconRSRC
displaysample me, theactor
Calls showMediaInActor to display the IconRSRC in the actor.

me (a IconRSRC)
theActor (an Actor)

See Also

the function showMediaInActor.

renderstretched of IconRSRC
renderStretched me, therenderer, theactor, region, thepaper
Renders the image in the IconRSRC stretching it to fill the region to be rendered.

rendertiled of IconRSRC
renderTiled me, therenderer, theactor, region, thepaper
Renders the image stored in the IconRSRC tiling it to fill the region to be painted.

me (an IconRSRC)
therenderer (an ImageRenderer): The renderer whose media is this
IconRSRC.
theactor (an Actor): The actor currently being drawn.
region (a Mask): The region to be painted.
thePaper: The surface on which the drawing takes place. This argument
should be passed "as is" to other render handlers and some handlers
defined on the Pen and Mask objects.

renderunstretched of IconRSRC
renderUnstretched me, therenderer, theactor, region, thepaper

Page 318
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s i z e o f I c o n R S R C

Renders the image stored in the IconRSRC once, placing its topleft corner at the topleft of
the region to be rendered (or offset by the values in the hOffset and vOffset property
of the renderer).

me (an IconRSRC)
therenderer (an ImageRenderer): The renderer whose media is this
IconRSRC.
theactor (an Actor): The actor currently being drawn.
region (a Mask): The region to be painted.
thePaper: The surface on which the drawing takes place. This argument
should be passed "as is" to other render handlers and some handlers
defined on the Pen and Mask objects.

size of IconRSRC
size me
Returns the size in pixels of the image stored by this media object.

me (an IconRSRC)

IconTextPicker
(a Picker)

This is a specialized picker with the ability to draw two icons and a piece of text for each item. The first
icon, if desired, will always appear on the left side of the picker. The second icon, if desired, always
appears to the left of the text some offset from the first icon (or edge if the first icon is not used). The text
always appears to the right of whatever icons are shown (or the edge if neither is used). Why this weird
way? Well this is the prototype used to build the HierarchicalPicker which implements a
"Finder-style" view. See the hierarchicalPicker for more information.
Despite this, this picker can be used as a simple picker which just has the one icon visible. This is useful
for pickers where you want both textual and graphic information. (Of course, you could do this with the
tablePicker, but it would not be as fast).

See Also
createArrow, createIcon

Page 319
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a r r o w s i z e o f I c o n Te x t P i c k e r

Properties of IconTextPicker

arrowsize of IconTextPicker
This property specifies the size of the first icon in pixels. Set this to False to have no
arrow drawn.

Getter
get the arrowSize of me

Setter
set the arrowsize of me
to NewValue

createtextcolors of IconTextPicker
When this property is set to True , then when items is set the CreateTextColor handler
will be called to generate a set of colors to use for each of the items.

Getter
get the createTextColors of me

Setter
set the createtextcolors of me
to NewValue

See Also

setuptextcolors

iconsize of IconTextPicker
This property specifies the size of the second icon in pixels. Set this to False to have no
icon drawn.

Getter
get the iconSize of me

Page 320
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t e x t c o l o r s o f I c o n Te x t P i c k e r

Setter
set the iconsize of me
to NewValue

textcolors of IconTextPicker
This property stores the list of renderers correpsonding to the items. This property is set
by setting the items when the createtextcolors property is true. Use
CreateTextColor to generate the appropriate renderers.

Getter
get the textColors of me

Setter
set the textcolors of me
to NewValue

See Also

setuptextcolors

Handlers of IconTextPicker

createarrow of IconTextPicker
createArrow me, theitem, thestring, theposition
This handler is used to generate the set of arrows to draw. This handler is called for every
item whenever the items property is set. It is passed the item as it's second argument
and should return a renderer or False .

me (an IconTextPicker)
theitem
thestring
theposition

createicon of IconTextPicker
createIcon me, theitem, thestring, theposition

Page 321
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c r e a t e o f f s e t o f I c o n Te x t P i c k e r

This handler is used to generate the set of icons to draw. This handler is called for every
item whenever the items property is set. It is passed the item as it's second argument
and should return a renderer or False .

me (an IconTextPicker)
theitem
thestring
theposition

createoffset of IconTextPicker
createOffset me, theitem, thestring, theposition
This handler is used to generate the set of offsets for the second item and it's text. This
handler is called for every item whenever the items property is set. It is passed the item
as it's second argument and should return an integer.

me (an IconTextPicker)
theitem
thestring
theposition

createtextcolor of IconTextPicker
createTextColor me, itemlocation
This handler is used to generate the set of colors used for each piece of text. This handler
is called for every item whenever the items property is set. It is passed the item as it's
second argument and should return an rgbcolor.

me (an IconTextPicker)
itemlocation

See Also

CreateTextColors , TextColors

pointonwhichpart of IconTextPicker
pointOnWhichPart me, x, y
with part
with tracking
This handler depends on the 'part' keyword. If this keyword is false, it calls the inherited
PointOnWhichPart of Actor handler. If this is 'item', then this returns the the item at
the specified x, y location. If this is 'itemAndPosition', it will return a list of the two

Page 322
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e t u p t e x t c o l o r s o f I c o n Te x t P i c k e r

values. The first is the item. The second is either 'arrow', 'icon' or 'text' specifying where
on the item the location is.

me (an IconTextPicker)
x
y
[with part]
[with tracking]

setuptextcolors of IconTextPicker
setupTextColors me
Whenever the items property is set, it calls this function to setup the list stored in the
textColors property. By default, this function checks if CreateTextColors is set to
True , and if so calls CreateTextColor on each item to construct the set of text colors.

me (an IconTextPicker)

IllegalFilenameError
(a FileError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

ImageCompressionError
(a SystemError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

Page 323
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e t u p t e x t c o l o r s o f I c o n Te x t P i c k e r

ImageRenderer
(a Renderer)

The ImageRenderer is in charge of rendering anything that has image media associated to it. The
ImageRenderer can thus render PICTs, cicns, ppats, PATs and pixelMaps.
Through the renderStyle property, the ImageRenderer lets you specify three ways to paint the image
associated to it:
(1) stretch it to fill a region.
(2) tile it to fill a region.
(3) do not tile or stretch: just show it at its natural size within the region.
The ImageRenderer lets you do all this regardless of the type of media you are using with it.
Note: The ImageRenderer 's media can be any descendant of Media that has the following three
handlers defined: renderStretched , renderTiled and renderUnstretched . In a fresh SK8 these
are any descendants of QDPicture , PixelMap , BWPattern , ColorPattern and iconRSRC .◆
Since it might be the case that an ImageRenderer's image is irregularly shaped and does not fill the whole
area to be rendered, the ImageRenderer first paints the backGroundRenderer into the region to be drawn.
On top of that, the imageRenderer's image (from its media ) is painted.
Note: if the media of your imageRenderer does cover all the area given to it to render, it is a good idea
to set the backGroundRenderer to False . This saves a whole rendering step, making your renderer
substantially faster.◆
The final property worth mentioning at this juncture of the narrative is the translucentColor
property. With this property you can specify an RGBColor that should be treated as transparent. Thus, if
you set this property to Red , every pixel in your renderer's image that is red will be transparent, showing
what lies behind the actor being rendered with your renderer.

Example
Suppose you are writing a chess program. Your first task is to draw the board. Let "Board" be the
rectangle you have created for this purpose. The board can be rendered easily with a simple black and
white pattern if you think of it as a blown up pattern. So we will find the appropriate pattern and stretch
it to fill our board. First we make the renderer. Then we associate it to the right media and set the board's
fillcolor to the renderer.
new imageRenderer with objectname "boardRenderer"
set boardRenderer's media to GrayPattern
set board's fillcolor to the boardRenderer
You will notice that the board just looks like a gray matt all over which is not what we wanted. The
problem is that the renderStyle of an ImageRender that renders a pattern defaults to
'renderTiled' which makes sense for patterns. We want our pattern to be stretched. Therefore we just
set boardRenderer's renderStyle to 'renderStretched'

Page 324
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b a c k g r o u n d r e n d e r e r o f I m a g e R e n d e r e r

And we tell the board to redraw itself to show the change. (Note that the change does not happen
automatically because a renderer has no way of knowing all the actors it is rendering).
lightForceRedraw board
And that's it. If are in an exploratory mood you can try setting the renderStyle to
'renderUnstretched' and see the pattern in all its original glory. (Doing this, by the way is a simple
way of finding out how big a pattern is).

See Also
media , renderStyle , backgroundRenderer and translucentColor.

Properties of ImageRenderer

backgroundrenderer of ImageRenderer
The renderer to use to render the background (behind the media). If False no rendering
of the background is done.
Note: If your media is guaranteed to coved all the region it is to render, the
backGroundRenderer should be False . This will make the rendering a lot faster.◆

Note: setting this property to a translucent renderer might change the state of this
renderer so that its translucent handler now returns True . When this happens it is
important to inform every actor that is being rendered by this renderer of the changes.
You do this by setting the fillColor (or frameColor ) of the affected actors to this
renderer again. Failure to do this might result in draw errors.◆

Getter
get the backgroundRenderer of me

me (an ImageRenderer)

Setter
set the backgroundrenderer of me
to NewValue

me (an ImageRenderer)
to: A Renderer or False, to indicate that no rendering of the background is
necessary.

Page 325
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h o f f s e t o f I m a g e R e n d e r e r

hoffset of ImageRenderer
Specifies the number of pixels to offset the image when rendering. Defaults to 0, meaning
that the image will be lined up with the left edge of the mask being rendered. This
property is only visible when the renderStyle is 'renderUnstretched' .

Getter
get the hOffset of me

me (an ImageRenderer)

Setter
set the hoffset of me
to NewValue

me (an ImageRenderer)
to (an Integer): The number of pixels to offset the image in the horizontal
direction.

See Also

renderStyle .

Media of ImageRenderer
The renderer's media. Should descend from one of the following media objects:
QDPicture , iconRSRC , BWPattern , ColorPattern or PixelMap .

Getter
get the Media of me

me (an ImageRenderer)

Setter
set the media of me
to NewValue

Sets the media the ImageRenderer uses to render an arbitrary region. If set to False , uses
the ErrorColor to render itself.

Note: If the new media's type differs from the old media's type, the renderStyle of the
renderer will be changed to be the defaultRenderStyle of the new media. For
example, if the old media was an IconRSRC , the renderStyle was set to

Page 326
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e n d e r s t y l e o f I m a g e R e n d e r e r

'renderTiled' and the new media is a child of QDPicture , the render style would be
changed to 'renderStretched' which is the defaultRenderStyle of QDPicture .◆

me (an ImageRenderer)
to: A descendant of QDPicture , IconRSRC , PixelMap , BWPattern or
ColorPattern . Can also be set to False .

See Also

renderStyle , and defaultRenderStyle of Media .

renderstyle of ImageRenderer
This property determines what the renderer does with the media. Possible values for it are:
'renderStretched' : the image is stretched to fill the region.
'renderTiled' : the image is tiled to fill the region.

'renderUnstretched' : the image is rendered with its natural size using the hOffset
and vOffset properties to determine their position.
Note: For the change to take effect in an actor being rendered with the renderer in
question you have to force the actor to redraw itself. You can do this by calling
lightForceRedraw.◆

Getter
get the renderStyle of me

me (an ImageRenderer)

Setter
set the renderstyle of me
to NewValue

me (an ImageRenderer)
to: One of 'renderStretched' , 'renderTiled' and
'renderUnstretched' .

See Also

hOffset , vOffset , lightForceRedraw of Actor and ImageRenderer for an


example of the use of this property.

Page 327
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t r a n s l u c e n t c o l o r o f I m a g e R e n d e r e r

translucentcolor of ImageRenderer
With this property you can specify an RGBColor that should be treated as transparent.
Thus, if you set this property to Red , every pixel in your renderer's image that is red will
be transparent, showing what lies behind the actor being rendered with your renderer.
Note: using this property is significantly more expensive than not using it. Do not use it
when it is not required.◆
Note: setting this property to an RGBColor when it was previously False might change
the state of this renderer so that its translucent handler now returns True . When this
happens it is important to inform every actor that is being rendered by this renderer of the
changes. You do this by setting the fillColor (or frameColor ) of the affected actors to
this renderer again. Failure to do this might result in draw errors.◆

Getter
get the translucentColor of me

me (an ImageRenderer)

Setter
set the translucentcolor of me
to NewValue

me (an ImageRenderer)
to: An RGBColor or False , to signify that this effect is not wanted.

voffset of ImageRenderer
Specifies the number of pixels to offset the image when rendering. Defaults to 0, meaning
that the image will be lined up with the top edge of the mask being rendered. This
property is only visible when the renderStyle is 'renderUnstretched' .

Getter
get the vOffset of me

me (an ImageRenderer)

Setter
set the voffset of me
to NewValue

Page 328
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c a p t u r e p i c t u r e o f I m a g e R e n d e r e r

me (an ImageRenderer)
to (an Integer): The number of pixels to offset the image in the vertical
direction.

See Also

hOffset , renderStyle .

Handlers of ImageRenderer

capturepicture of ImageRenderer
capturePicture me, otheractor
with size
The capturePicture handler takes a snapshot of an actor or a renderer and places it in
an imageRenderer.
You can specify the size you want the cached pixmap to have. This is very important
since the size of the cached pixmap determines the amount of memory the imageRenderer
will use.
Consider an actor called "act" whose size is 400 by 600 pixels. You want to capture its
picture to render a rectangle whose size is 50 x 50. Assume you have snp, an
imageRenderer you created. Then the simplest thing is to just call CapturePicture as
follows:
capturePicture snp, act
Note that no size is provided. The system assumes you want to cache act's image in all
its glory and thus allocates a pixmap of act's size. The memory required for it is therefore
400 x 600 x depth/8
Assuming 256 colors (8 bit color), we get 240000 bytes = 240K
This is a clear waste if we are only going to be using our renderer to render the small (50 x
50) rectangle. We should instead do the following:
capturePicture snp, act with size {50,50}
This will allocate a pixmap of the right size and the memory usage will be
50 x 50 x 1 = 2500 = 2.5K !!!
Need we say more?
Note: If otherActor is a renderer the size argument is required.◆

Page 329
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e n d e r o f I m a g e R e n d e r e r

me (an ImageRenderer)
otheractor: The Actor or Renderer to be captured.
[with size]: A list of two integers specifying the width and height.

Example
In the following example the MessageBox is captured and the resulting imageRenderer
used to paint an actor. We make the renderer.
new imageRenderer with objectName "msb"
We take a snap shot of the MessageBox and store it in the renderer.
capturePicture msb, messagebox
Now we render an actor's fill with msb.
set myActor's fillcolor to msb
The capturePicture handler is used to make the snap shot. It creates a new media of
type PixelMap to store the data in.

render of ImageRenderer
render me, theactor, region, thepaper
Paints the region passed to it by calling the appropriate render handler of its media. The
handler to use is stored in the renderStyle property.

me (an ImageRenderer)
theactor (an Actor): The Actor being rendered.
region (a Mask): The mask to be rendered by this renderer.
thePaper: The surface on which the drawing takes place. This argument
should be passed "as is" to other render handlers and some handlers
defined on the Pen and Mask objects.

Example
Here is the code that could define this handler. It shows that the rendering is delegated to
the renderer's media and its appropriate render handler.

Page 330
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
Tr a n s l u c e n t o f I m a g e R e n d e r e r

on render of me (an ImageRenderer), theActor, region


if my renderStyle = 'renderStretched' then
renderStretched my media, theActor, region
else
if myRenderStyle = 'renderTiled' then
renderTiled my media, theActor, region
else
renderUnstretched my media, theActor, region
end if
end if
end render

See Also

renderStyle , media .

Translucent of ImageRenderer
Translucent me
Returns True if the translucentColor is not False .

me (an ImageRenderer)

See Also

translucentColor.

IncorrectArgumentsError
(a ProgrammaticError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

Page 331
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a r g u m e n t s o f I n c o r r e c t A r g u m e n t s E r r o r

Properties of IncorrectArgumentsError

arguments of IncorrectArgumentsError

Getter
get the arguments of me

Setter
set the arguments of me
to NewValue

handlername of IncorrectArgumentsError

Getter
get the handlerName of me

Setter
set the handlername of me
to NewValue

Handlers of IncorrectArgumentsError

writeobject of IncorrectArgumentsError
writeObject me, thestream, rereadably

me (an IncorrectArgumentsError)
thestream
rereadably

Page 332
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
A r r a y o f I n c o r r e c t S u b s c r i p t s E r r o r

IncorrectSubscriptsError
(a ProgrammaticError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

Properties of IncorrectSubscriptsError

Array of IncorrectSubscriptsError

Getter
get the Array of me

Setter
set the array of me
to NewValue

rank of IncorrectSubscriptsError

Getter
get the rank of me

Setter
set the rank of me
to NewValue

Handlers of IncorrectSubscriptsError

writeobject of IncorrectSubscriptsError
writeObject me, thestream, rereadably

Page 333
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
A r r a y o f I n d e x O u t O f B o u n d s E r r o r

me (an IncorrectSubscriptsError)
thestream
rereadably

IndexOutOfBoundsError
(a ProgrammaticError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

Properties of IndexOutOfBoundsError

Array of IndexOutOfBoundsError

Getter
get the Array of me

Setter
set the array of me
to NewValue

index of IndexOutOfBoundsError
The index which produced the IndexOutOfBoundsError

Getter
get the index of me

Setter
set the index of me
to NewValue

Page 334
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w r i t e o b j e c t o f I n d e x O u t O f B o u n d s E r r o r

Handlers of IndexOutOfBoundsError

writeobject of IndexOutOfBoundsError
writeObject me, thestream, rereadably

me (an IndexOutOfBoundsError)
thestream
rereadably

IndirectText
(a Text)

Properties of IndirectText

basetext of IndirectText

Getter
get the baseText of me

Setter
set the basetext of me
to NewValue

currentcharacter of IndirectText

Getter
get the currentCharacter of me state

Page 335
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
f r o m s t a t e o f I n d i r e c t Te x t

me (an IndirectText)
state

Setter
set the currentcharacter of mestate
to NewValue

me (an IndirectText)
state
to

fromstate of IndirectText

Getter
get the fromState of me

Setter
set the fromstate of me
to NewValue

textcolor of IndirectText

Getter
get the textColor of me

me (an IndirectText)

Setter
set the textcolor of me
to NewValue

me (an IndirectText)
to

Page 336
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t e x t f o n t o f I n d i r e c t Te x t

textfont of IndirectText

Getter
get the textFont of me

me (an IndirectText)

Setter
set the textfont of me
to NewValue

me (an IndirectText)
to

textsize of IndirectText

Getter
get the textSize of me

me (an IndirectText)

Setter
set the textsize of me
to NewValue

me (an IndirectText)
to

textstyle of IndirectText

Getter
get the textStyle of me
with num

me (an IndirectText)
[with num]

Page 337
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t o s t a t e o f I n d i r e c t Te x t

Setter
set the textstyle of me
to NewValue

me (an IndirectText)
to

tostate of IndirectText

Getter
get the toState of me

Setter
set the tostate of me
to NewValue

Handlers of IndirectText

empty of IndirectText
empty me

me (an IndirectText)

mapcharacterchunks of IndirectText
mapCharacterChunks me, rangestart, rangeend, functionorname

me (an IndirectText)
rangestart
rangeend
functionorname

mapcharacterchunksformods of IndirectText
mapCharacterChunksForMods me, rangestart, rangeendpair,
functionorname

Page 338
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a p c h a r a c t e r s o f I n d i r e c t Te x t

me (an IndirectText)
rangestart
rangeendpair
functionorname

mapcharacters of IndirectText
mapCharacters me, fromindex, toindex, functionorname

me (an IndirectText)
fromindex
toindex
functionorname

maplinechunks of IndirectText
mapLineChunks me, rangestart, rangeend, functionorname

me (an IndirectText)
rangestart
rangeend
functionorname

maplinechunksformods of IndirectText
mapLineChunksForMods me, rangestart, rangeendpair, functionorname

me (an IndirectText)
rangestart
rangeendpair
functionorname

mapparagraphchunks of IndirectText
mapParagraphChunks me, rangestart, rangeend, functionorname

me (an IndirectText)
rangestart
rangeend
functionorname

Page 339
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a p p a r a g r a p h c h u n k s f o r m o d s o f I n d i r e c t Te x t

mapparagraphchunksformods of IndirectText
mapParagraphChunksForMods me, rangestart, rangeendpair,
functionorname

me (an IndirectText)
rangestart
rangeendpair
functionorname

mapwordchunks of IndirectText
mapWordChunks me, rangestart, rangeend, functionorname

me (an IndirectText)
rangestart
rangeend
functionorname

mapwordchunksformods of IndirectText
mapWordChunksForMods me, rangestart, rangeendpair, functionorname

me (an IndirectText)
rangestart
rangeendpair
functionorname

reversemapcharacterchunks of IndirectText
reverseMapCharacterChunks me, rangestart, rangeend, functionorname

me (an IndirectText)
rangestart
rangeend
functionorname

reversemaplinechunks of IndirectText
reverseMapLineChunks me, rangestart, rangeend, functionorname

Page 340
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e v e r s e m a p p a r a g r a p h c h u n k s o f
I n d i r e c t Te x t

me (an IndirectText)
rangestart
rangeend
functionorname

reversemapparagraphchunks of IndirectText
reverseMapParagraphChunks me, rangestart, rangeend, functionorname

me (an IndirectText)
rangestart
rangeend
functionorname

reversemapwordchunks of IndirectText
reverseMapWordChunks me, rangestart, rangeend, functionorname

me (an IndirectText)
rangestart
rangeend
functionorname

InputOutputPort
(an OutputPort, InputPort)

InputOuputPorts allow two or more Properties to “track” each other so that when any of the Properties
changes value, the others are set to the new value. Their wiring is functionally different from the other
types of Ports, and since some confusing issues would arise if InputOutputPorts were to be wired to the
other types of ports, such wiring is not currently permitted. This isn't a limitiation however, since any
number of any type of Port can be attached to a property.

See Also
InputPort , OutputPort .

Page 341
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w i r e d t o o f I n p u t O u t p u t P o r t

Properties of InputOutputPort

wiredto of InputOutputPort
This property stores all the ports that are connected to this port. The setter should not be
used directly.

Getter
get the wiredTo of me

me (an InputOutputPort)

See Also

unwirePort , unwirePorts , wirePorts , addInputPort , addOutputPort ,


attachPort , detachPort .

Handlers of InputOutputPort

activateinputport of InputOutputPort
activateInputport me, oldvalue, newvalue, fromport
This handler is the mechanism by which an OutputPort (or InputOutputPort) activates an
InputPort (InputOutputPort) it is wired to. ActivateInputPort calls the setter on the
property and object the Inputport is attached to, though you can modify it to perform
other actions.

me (an InputOutputPort)
oldvalue
newvalue
fromport

See Also

activateOutputPort .

Page 342
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a c t i v a t e o u t p u t p o r t o f I n p u t O u t p u t P o r t

activateoutputport of InputOutputPort
activateOutputport me, oldvalue, newvalue
This handler is called when the property (specified by the by the Port's portProperty) of
the object (specified by the Port's portObject) changes. The default handler calls
activateInputPort on all the Ports that this InputOutputPort is connected to. You can
modify the activateOutputPort handler to process or modify the value it is passed.

me (an InputOutputPort)
oldvalue
newvalue

See Also

activateInputPort .

portscompatible of InputOutputPort
portsCompatible me, otherioport
Checks the signatures of the two Ports to see if it is permissible to wire them together.
Returns True if they can be wired; False , if not.

me (an InputOutputPort)
otherioport

See Also

autoWire, signature(for the rules for compatibility)

porttype of InputOutputPort
portType me
Returns the symbol 'input' for an InputPort, 'output' for an OutputPort, 'inputoutput' for
an InputOutputPort, and False for any other type of Port (other types of Ports aren't
currently supported).

me (an InputOutputPort)

unwireport of InputOutputPort
unwirePort me
Removes all wired connections to this Port.

Page 343
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
u n w i r e p o r t s o f I n p u t O u t p u t P o r t

me (an InputOutputPort)

See Also

wirePort, wirePorts, wiredTo

unwireports of InputOutputPort
unwirePorts me, toport

me (an InputOutputPort)
toport

InputPort
(a Port)

When an InputPort attached to an object is active, it sets the value of the Property the InputPort is
attached to.
Note: Set Parent Object: Port◆

Handlers of InputPort

activateinputport of InputPort
activateInputport me, oldvalue, newvalue, fromport
This handler is the mechanism by which an OutputPort activates an InputPort it is wired
to. ActivateInputPort calls the setter on the property and object the Inputport is attached
to, though you can modify it to perform other actions.

me (an InputPort)
oldvalue
newvalue
fromport

Page 344
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a t t a c h p o r t o f I n p u t P o r t

See Also

activateOutputPort

attachport of InputPort
attachPort me
with object
with property
Attaches a Port to a specified Object's property.

me (an InputPort)
[with obj]
[with property]

See Also

detachPort

porttype of InputPort
portType me
Returns the symbol 'input' for an InputPort, 'output' for an OutputPort, 'inputoutput' for
an InputOutputPort, and False for any other type of Port (other types of Ports aren't
currently supported).

me (an InputPort)

unwireport of InputPort
unwirePort me
Removes all connections to this Port.

me (an InputPort)

wiredto of InputPort
wiredTo me
Returns a list of all Ports that this Port is wired to.

me (an InputPort)

Page 345
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w i r e d t o o f I n p u t P o r t

Integer
(a Real)

This object is the ancestor of all integers. Integers are further categorized by SmallInteger and
BigInteger.

Note: The choice between SmallInteger and BigInteger for integer representation is handled
automatically by the system based on the magnitude of the integer; you cannot coerce a SmallInteger
to a BigInteger, or vice versa.◆

See Also
SmallInteger, BigInteger

IODriverError
(a SystemError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

Keyboard
(a Device)

Prototype for keyboards connected to the current system environment.


This allows you to query the children of Keyboard or ask for the keyboards of the System to get all
keyboards installed in the system environment. You can get information about the keyboard when it is
provided by the operating system.
A set of system functions are available to help you determine the current state of the keyboard.

See Also
See also the functions getKeys, shiftKeyDown, optionKeyDown, commandKeyDown, controlKeyDown,
and capsKeyDown

Page 346
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
k e y s d o w n o f K e y b o a r d

Handlers of Keyboard

keysdown of Keyboard
keysDown me
Returns a list of keys which are currently depressed. Returns False when no keys are
depressed. This does not return the modifier keys. Use shiftKeyDown and similar
handlers to get the status of the modifier keys.
Note: Not implemented in 1.0a2◆

me (a Keyboard)

Example
get keysDown of the Keyboard

Label
(a Rectangle)

The Label displays a single line of text, which is non-editable. Labels are useful for showing short,
read-only text strings. The Label is a child rectangle, with three main differences:
(1) the default framesize of label is {0,0} (the frame is not visible).
(2) the label's fillcolor is Transparent and thus, only the text is visible.
(3) when the label's text is set, the label's width grows or shrinks so that it is large enough to display all
of its text.
The Label's size changes whenever you change its text , its textFont , its textHOffset , its
textVOffset , its textSize or its textStyle .

You can control in which direction the label resizes with the textLocation property. If the
textLocation is, for example, 'centerLeft' then the label will grow or shrink to the right and the
text's start will not move. If the textLocation is 'centerRight' , the label will resize to the left,
keeping the end of the text in the same location.

Page 347
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
Te x t o f L a b e l

Properties of Label

Text of Label
The Label only redefines the setter of this property. See the Actor property for more
details.

Setter
set the text of me
to NewValue

Sets the text of the label. Calls the Actor 's handler to do the work. After the text has been
set, it recomputes the label's size so that all the text is visible.

me (a Label)
to (a String)

See Also

text of Actor.

textfont of Label
The Label only redefines the setter of this property. See the Actor property for more
details.

Setter
set the textfont of me
with start
with end
to NewValue

Sets the textFont of the Label . Calls the Actor handler to do the work. When a new
font is set, it recomputes the label's size so that all the text is visible.

me (a Label)
[with start]: Ignored.
[with end]: Ignored.
to: A font or the name of a font (a string).

Page 348
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t e x t s i z e o f L a b e l

textsize of Label
The Label only redefines the setter of this property. See the Actor property for more
details.

Setter
set the textsize of me
with start
with end
to NewValue

Sets the textSize of the label. Calls the Actor handler to do the work. When a new size
is set, it recomputes the label's size so that all the text is visible.

me (a Label)
[with start]: Ignored.
[with end]: Ignored.
to (an Integer)

See Also

textSize of Actor.

textstyle of Label
The Label only redefines the setter of this property. See the Actor property for more
details.

Setter
set the textstyle of me
to NewValue

Sets the textStyle of the label. Calls the Actor handler to do the work. When a new
style is set, it recomputes the label's size so that all the text is visible.

me (a Label)
to: A list of styles.

See Also

textStyle of Actor.

Page 349
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e t f r a m e s i z e o f L a b e l

Handlers of Label

setframesize of Label
setFrameSize me, h, v
with physical
Sets the framesize of the label and resizes it if necessary to make sure all the text in the
label is visible.

me (a Label)
h (a Number): The width of the frame.
v (a Number): The height of the frame.
[with physical] (a boolean): If True , the size is assumed to be provided in
pixels.

See Also

setFrameSize of Actor.

Line
(a TextChunk)

This is the object that represents a line of text. A child of TextChunk . It is used as a special type of
collection.

See Also
TextChunk .

linearTextPicker
(a Rectangle)

Page 350
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i t e m s o f L i n e a r Te x t P i c k e r

A picker in which each item is presented next to each other horizontally like words in an editText field.
Otherwise behaves just like the picker. You set its items and when you click a whole item is selected. This
picker is used in the script editor for the locals and globals panels.

Properties of linearTextPicker

items of LinearTextPicker
Stores the picker's items.

Getter
get the items of me

Setter
set the items of me
to NewValue

Sets the items of the LinearTextPicker to the items specified. CreateTextDisplay items is
called on each item to get its textual representation. The new items are displayed.

me (a LinearTextPicker)
to: A list of SK8 objects.

See Also

createTextDisplayItem

myfield of LinearTextPicker
Returns the LinearPickerText (a child of EditText) used to show the Picker's items.
Note: This property is a tag.◆

Getter
get the myField of me

Setter
set the myfield of me
to NewValue

Page 351
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m y s c r o l l e r o f L i n e a r Te x t P i c k e r

myscroller of LinearTextPicker
Returns the scroller that is used to scroll the picker's Edittext.
Note: This property is a tag.◆

Getter
get the myScroller of me

Setter
set the myscroller of me
to NewValue

strings of LinearTextPicker
Stores the strings used to represent the items in the picker. These strings are built using
calls to the createTextDisplayItem of the picker.

Getter
get the strings of me

Setter
set the strings of me
to NewValue

See Also

createTextDisplayItem

Text of LinearTextPicker

Setter
set the text of me
to NewValue

Sets the linearTextPicker's text. This text acts as the title of the item list. Since it appears to
the left of the items, the editText that shows the items need to be resized to avoid colliding
with the new text. And that, it what this handler does after doing the inherited thing.

me (a LinearTextPicker)
to (a String)

Page 352
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c r e a t e t e x t d i s p l a y i t e m o f L i n e a r Te x t P i c k e r

Handlers of linearTextPicker

createtextdisplayitem of LinearTextPicker
createTextDisplayItem me, theitem
Returns the objectString of the item.

me (a LinearTextPicker)
theitem: The item whose text representation we want to obtain.

See Also

objectString of Object

minimumsize of LinearTextPicker
minimumSize me
Returns {140,30} . The LinearTextPicker really looks stupid if it gets smaller than that.
And you don't want your projects to look stupid, do you?

me (a LinearTextPicker)

resized of LinearTextPicker
resized me
Calls bestsize on every item in its contents, so that they resize to fit in the right places
within the LinearTextPicker.

me (a LinearTextPicker)

selecteditems of LinearTextPicker
selectedItems me
Returns the item currently selected in the picker.

me (a LinearTextPicker)

Page 353
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a n g l e o f L i n e S e g m e n t

LineSegment
(an Actor)

A LineSegment actor is a straight line between two endpoints. Like a polygon, it can be rotated.

See Also
endpoints , lineSize , angle .

Properties of LineSegment

angle of LineSegment
This property determines the angle of rotation of the LineSegment. Each time you set the
endPoints of the line, the line's angle is set to 0. This is assumed to be the line's natural
state. Since a line is always rotated from the original endpoints you have set, the angle is
set to 0 when the endpoints are changed.
The angle is specified in radians (2pi radians = 360 degrees).

Getter
get the angle of me

me (a LineSegment)

Setter
set the angle of me
with relative
with anchorpoint
to NewValue

The setter calls rotate to do the work.

Page 354
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o l o r d e p t h o f L i n e S e g m e n t

me (a LineSegment)
[with relative] (a Boolean): If True , the angle specified is added to the
current angle . Defaults to False .
[with anchorpoint]: Specifies which point to rotate around. Options are
False (rotate around the line's location ), 'start' (the
startPoint remains fixed) and 'end' (the endPoint remains fixed).
to (a Number): The new angle.

See Also

rotate .

colordepth of LineSegment
The setter of this property is redefined to make sure that the colorDepth of all lines that
become windows is False .

Setter
set the colordepth of me
to NewValue

me (a LineSegment)
to

See Also

colorDepth of Actor.

endpoint of LineSegment
This property specifies the location of the point at which the line ends. It is a virtual
property, computed from the endPoints property.

Getter
get the endpoint of me
with physical

me (a LineSegment)
[with physical]: If True , the endpoint is returned in Stage coordinates.
Defaults to False .

Page 355
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e n d p o i n t s o f L i n e S e g m e n t

Setter
set the endpoint of me
with physical
with relative
to NewValue

This handler calls setEndPoint to do the work.

me (a LineSegment)
[with physical]: If True , the endpoint is assumed to be given in Stage
coordinates. Defaults to False .
[with relative]: If True , the point is interpreted as an offset to apply relative
to the current endpoint. The default is False .
to: The new endpoint as a list of two numbers.

See Also

endPoints , setEndPoint and setEndPoints .

endpoints of LineSegment
This property specifies the endpoints of the line as a list of four numbers: the first two are
the startPoint and second two are the endPoint .

Getter
get the endPoints of me
with physical

me (a LineSegment)
[with physical] (a boolean): If True , the points are returned in Stage
coordinates. The default is False .

Setter
set the endpoints of me
with physical
with relative
to NewValue

SetEndpoints is called to do the work.

Page 356
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l i n e s i z e o f L i n e S e g m e n t

me (a LineSegment)
[with physical] (a boolean): If True , the points are assumed to be given in
Stage coordinates. The default is False .
[with relative] (a boolean): If True , the 4 values are assumed to be offsets for
the current endPoints: we add each new value to the previous values.
The default is False .
to: The endpoints as a list of 4 numbers.

See Also

setEndPoints , startPoint and endPoint .

linesize of LineSegment
Specifies the width of the line in pixels.

Getter
get the lineSize of me

me (a LineSegment)

Setter
set the linesize of me
to NewValue

me (a LineSegment)
to (an Integer)

startpoint of LineSegment
This property determines the location of the line's startPoint .

Getter
get the startPoint of me
with physical

me (a LineSegment)
[with physical] (a boolean): If True , the point is returned in Stage
coordinates. The default is False .

Page 357
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a d d e d m e a s p a r e n t o f L i n e S e g m e n t

Setter
set the startpoint of me
with physical
with relative
to NewValue

Sets the startPoint of the lineSegment. Calls setStartPoint to do the work.

me (a LineSegment)
[with physical] (a boolean): If True , the numbers are assumed to be
provided in physical coordinates.
[with relative] (a boolean): If True , it interprets then numbers provided as
offsets from the current startPoint.
to: The startPoint as a list of two numbers.

See Also

setStartPoint .

Handlers of LineSegment

addedmeasparent of LineSegment
addedMeAsParent me, child, oldparents
Performs all that is required to turn an object into a LineSegment .

me (a LineSegment)
child
oldparents

See Also

addedMeAsParent of Object .

getshapefromuser of LineSegment
getShapeFromUser me
with starth
with startv
with multipledraw
with boundsrectset

Page 358
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n i t i a l i z e o f L i n e S e g m e n t

This handler provides a direct manipulation interface to obtain the endPoints of a


LineSegment. It should be invoked within a mouseDown handler, where the user can drag
the mouse to set the other endpoint of the LineSegment. When the mouse is released, the
endPoints specified are returned.
If startH and startV are not given, the current location of the mouse is used for the
startPoint . This is good enough in most cases. You can provide different values to
override.

me (a LineSegment)
[with starth]: The horizontal location (in Stage coordinates) at which the
line will start being drawn.
[with startv]: The vertical location (in Stage coordinates) at which the line
will start being drawn.
[with multipledraw]: Ignored.
[with boundsrectset] (a boolean): If True , the endpoints of the
lineSegment passed in the me argument are set before this handler
returns. Defaults to False .

See Also

endPoints .

initialize of LineSegment
initialize me, original, isnew, initargs
Calls the inherited handler to initialize the actor and then initializes the endpoints of the
lineSegment. This handler is called when a new lineSegment is created. It need not be
called directly.

me (a LineSegment)
original
child
args

makeboundsregion of LineSegment
makeBoundsRegion me
Computes the boundsRegion of the LineSegment .

me (a LineSegment)

Page 359
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a k e fi l l r e g i o n o f L i n e S e g m e n t

makefillregion of LineSegment
makeFillRegion me
This method does nothing since the fillRegion of a LineSegment is always empty.

me (a LineSegment)

makeframeregion of LineSegment
makeFrameRegion me
This handler does nothing since the frameRegion of a LineSegment is always empty.

me (a LineSegment)

newcontentok of LineSegment
newContentOk me, newcontent
Always returns False . The LineSegment does not allow any contents since they
cannot be seen.

me (a LineSegment)
newcontent

See Also

newContentOk of Actor.

resize of LineSegment
resize me, how
with live
with otheractors
This handler allows you to resize the LineSegment by direct manipulation. Basically, you
use the mouse to grab one of the endPoints and move it while the other one remains
fixed. The endpoints chosen to be moved is the one closest to the mouse.
Note: It is best to call this handler from the body of a mousedown handler.◆

Page 360
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r o t a t e o f L i n e S e g m e n t

me (a LineSegment)
how: Ignored since there is only one way to resize a LineSegment .
[with live] (a boolean): If True , the LineSegment is resized live. Otherwise
an outline of the line is resized.
[with otheractors]: A list of actors. If this argument is provided, the resize
handler calls the Actor resize handler to do the work and the
LineSegment is resized like any other actor (using the boundsRect). This
is not pleasant for line segments.

See Also

endpoints and resize of Actor.

rotate of LineSegment
rotate me, angle
with relative
with anchorpoint
Rotates the lineSegment so that its angle is the angle specified.

me (a LineSegment)
angle (a Number): The angle to rotate to. Expressed in radians (2pi radians =
180 degrees).
[with relative] (a boolean): If True , the angle specified is added to the line's
current angle . Defaults to False .
[with anchorpoint]: Specifies which point remains fixed when doing the
rotation. This argument can be False (the line rotates around its
location ), 'start' (the startPoint is fixed), and 'end' (the
endPoint is fixed).

setboundsrect of LineSegment
setBoundsRect me, left, top, right, bottom
with physical
with relative
with justmoving
SetBoundsRect changes the boundsRect by matching the appropriate vertices of the
rect to the appropriate endpoints . The endpoints of the LineSegment are updated to
coincide with the corners of the new bounds. In fact, this handler figures out what the
new endpoints should be and then calls setEndpoints to do all the work.

Page 361
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e t e n d p o i n t o f L i n e S e g m e n t

me (a LineSegment)
left (a Number): The position of the left side of the lineSegment's
boundsRect .
top (a Number): The position of the top side of the lineSegment's
boundsRect .
right (a Number): The position of the right side of the lineSegment's
boundsRect .
bottom (a Number): The position of the bottom side of the lineSegment's
boundsRect .
[with physical] (a boolean): If True the numbers are assumed to be
provided in Stage coordinates.
[with relative] (a boolean): If True , every number is assumed to be an offset
from the current value.
[with justmoving] (a boolean): If True , the graphics system assumes that
the LineSegment is not changing size allowing it to perform certain
optimizations.

See Also

setEndpoints .

setendpoint of LineSegment
setEndPoint me, h, v
with physical
with relative
Sets the end point of the lineSegment the point provided. Calls setEndpoints to do the
work.

me (a LineSegment)
h (a Number): The horizontal position of the endPoint.
v (a Number): The vertical position of the endPoint.
[with physical] (a boolean): If True , the numbers are assumed to be
provided in Stage coordinates.
[with relative] (a boolean): If True it is assumed that the numbers provided
are offsets of the current endPoint .

See Also

setEndPoints .

Page 362
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e t e n d p o i n t s o f L i n e S e g m e n t

setendpoints of LineSegment
setEndPoints me, h1, v1, h2, v2
with physical
with relative
with justmoving
Sets the endpoints of the lineSegment to points given.

me (a LineSegment)
h1 (a number): The horizontal coordinate of the startPoint .
v1 (a number): The vertical coordinate of the startPoint .
h2 (a number): The horizontal coordinate of the endPoint .
v2 (a number): The vertical coordinate of the endPoint .
[with physical] (a boolean): If True , it is assumed that the endpoints are
specified in physical coordinates.
[with relative] (a boolean): If True , it is assumed that the numbers provided
are offsets from the current endpoints.
[with justmoving] (a boolean): If True , it tells the system that the
LineSegment is not changing size allowing something optimizations to
be made.

setstartpoint of LineSegment
setStartPoint me, h, v
with physical
with relative
Sets the start point of the LineSegment to the point provided. setEndpoints is called to
do the work.

me (a LineSegment)
h (a Number): The horizontal position of the startPoint.
v (a Number): The vertical position of the startPoint.
[with physical] (a boolean): If True , the point is assumed to be specified in
physical coordinates.
[with relative] (a boolean): If True , the numbers are assumed to be offsets
from the current startPoint .

See Also

setEndpoints .

Page 363
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n v o k a b l e o f L o g E r r o r M e s s a g e

LogErrorMessage
(a ConditionResponse)

Invoking this response inserts a new ErrorLogObject (describing the current error) into SK8's
systemLog (which, by default, is the MessageBox ) and then aborts from the error.

The response is invokable when SK8's systemLog is accepting input (i.e. if the function canLogIt
returns True ).

See Also
ErrorLogObject , systemLog of SK8 , MessageBox , ConditionResponse , the Condition System
section of the User Guide's SK8Script Language chapter

Handlers of LogErrorMessage

invokable of LogErrorMessage
invokable me
Returns True if SK8's systemLog is accepting input (i.e. if the function canLogIt
returns True ).

me (a LogErrorMessage)

See Also

systemLog of SK8 , canLogIt , ConditionResponse

invoke of LogErrorMessage
invoke me
Inserts a new ErrorLogObject (describing the current error) into SK8's systemLog
(which, by default, is the MessageBox ) and then aborts from the error.

me (a LogErrorMessage)

See Also

ErrorLogObject , systemLog of SK8 , MessageBox , abortError,


ConditionResponse

Page 364
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w r i t e O b j e c t o f L o g E r r o r M e s s a g e

writeObject of LogErrorMessage
writeObject me, thestream, rereadably
If rereadably is True , this just does the inherited writeObject behavior.
Otherwise, if the response is invokable, it writes a description of what the
LogErrorMessage response will do when invoked. If the response is not invokable, it
writes an explanation of why it is not.

me (a LogErrorMessage)
thestream
rereadably

See Also

ConditionResponse , writeObject of Object

MacAlertBox
(a MacDialog)

The MacAlertBox is a very specialized version of the MacDialog , and acts in a very similar fasion to
the MacModalDialog .
In accordance with the Macintosh Human Interface Guidelines, it is composed of two buttons ("Cancel"
and "OK") in the lower right hand corner of the dialog, some expanatory text above them, and, in the top
left hand corner, an iconographic representation of the severity of the alert, specifically: 'note' ,
indicated by the silhouette of a person's head speaking, 'caution' , indicated by an exclamation mark
sign, or 'stop' , indicated by a stop sign. Following System 7.5 conventions, we also include the
alertTypes of 'colorNote' , 'colorCaution' , and 'colorStop' , which should be exactly what you
think they are.
For more information about how a MacAlertBox should be used, you should consult the Macintosh
Human Interface Guidelines.

See Also
MacWidget , MacDialog , MacModalDialog , MacMovableModalDialog

Page 365
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a l e r t Ty p e o f M a c A l e r t B o x

Properties of MacAlertBox

alertType of MacAlertBox
There are three basic types of alert: note, caution, and stop, each indicating a successively
higher level of severity.
Changing the alertType changes the renderer of the MacAlertBox's typeIcon (found in
the upper left hand corner of the dialog).

Getter
get the alerttype of me

Setter
set the alerttype of me
to NewValue

me (an EditText)
to newValue: One of 'note' , 'caution' , 'stop' , 'colorNote' ,
'colorCaution' , or 'colorStop' .

Handlers of MacAlertBox

resized of MacAlertBox
resized me
This resized handler just insures that the alert icon, explanatory text, and buttons stay in
the correct place depending on the size of the actual alert box.

MacAnimation
(a Rectangle, MacWidget)

Page 366
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c e l l s e t o f M a c A n i m a t i o n

This object is the parent class for the Macintosh Look & Feel Interface elements which are animated,
namely the MacBarberPole and MacRoundIndicator.
Every MacAnimation has a property cellSet which contains a list of renderers in the order of frames
in the animation. Also associated with each MacAnimation is a Clock , and, when the clock is started,
the MacAnimation will begin to change its renderers in the order that they appear in its cellSet
property. The rate of the animation can be set through the set rate handler, and the actual animation
can be started and stopped using startAnimation and stopAnimation .
An important thing to note is that a MacAnimation is not useful or displayable in and of itself. It must
be instantiated as another object, with its own cellSet, such as the MacBarberPole or
MacRoundIndicator.

See Also
MacWidget , MacBarberPole , MacRoundIndicator

Properties of MacAnimation

cellset of MacAnimation
This is the list of renderers, in order, that the MacAnimation will use when it is
animating. This property MUST be non-empty for things to work correctly.

Getter
get the cellset of me

Setter
set the cellset of me
to NewValue

Example
set myAnimation's cellSet to {barber1Renderer, barber2Renderer,
barber3Renderer}

Clock of MacAnimation
This is an actual clock object which ticks when the animation is moving. On every tick of
the clock, the animate handler of the MacAnimation is called, causing the animation's
renderer to change to the next renderer in the object's cellSet .

Page 367
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a n i m a t e o f M a c A n i m a t i o n

Getter
get the Clock of me

Setter
set the clock of me
to NewValue

See Also

Clock

Handlers of MacAnimation

animate of MacAnimation
animate me
with num
Calling this handler causes the renderer of the MacAnimation to change to the next
one in its cellSet .

me (a MacAnimation)

startAnimation of MacAnimation
startanimation me
This just starts the animation moving. (Actually, it starts the clock of the MacAnimation
ticking, but the effect is to start the animation.)

me (a MacAnimation)

stopAnimation of MacAnimation
stopanimation me
This handler stops the animation. (Actually, it stops the clock of the MacAnimation , but
the effect is the same.)

me (a MacAnimation)

Page 368
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i s A c t i v e o f M a c B u t t o n

MacBarberPole
(a MacAnimation)

This is the indefinite progress indicator that you can find in many Finder dialogs. It's known as a
MacBarberPole because it looks like the traditional striped Barber's Pole that you can see outside some
barber shops. (Except that while the actual barber's pole is vertical, with red and white stripes animating,
ours is horizontal, with blue and gray stripes moving.)

See Also
MacWidget , MacRoundIndicator, MacAnimation

MacButton
(a MacWidget, RoundRect)

This is the standard Macintosh button that is typically found in dialog windows.

See Also
MacWidget , MacDialog , MacModalDialog , MacMovableModalDialog , MacRadioButton ,
MacCheckbox

Properties of MacButton

isActive of MacButton
This property determines whether the MacButton is clickable and black (when the value
is true ) or non-clickable and grayed out. (when it is false ),

Setter
set the isactive of me
to NewValue

me (a MacButton)
[to] (a boolean)

Page 369
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i s D e f a u l t o f M a c B u t t o n

See Also

MacWidget , MacDialog , MacModalDialog , MacMovableModalDialog ,


MacRadioButton , MacCheckbox

isDefault of MacButton
This property determines whether the button is the default action for a dialog. For
example, in an OpenFileDialog , the "Open" button would be the default. Setting this
property to true only affects the button's appearance however (i.e., by putting a thick
outline around it), not it's behavior--you have to do that yourself.

Getter
get the isdefault of me

[me] (a MacButton)

Setter
set the isdefault of me
to NewValue

me (a MacButton)
[to] (a boolean)

See Also

MacWidget , MacDialog , MacModalDialog , MacMovableModalDialog ,


MacRadioButton , MacCheckbox

Handlers of MacButton

doaction of MacButton
doaction me
This handler is meant to be overridden by you, the SK8 programmer. Whenever a
MacButton gets pressed, this handler, or, hopefully, one of its descedants will be called.

See Also

MacWidget , MacDialog , MacModalDialog , MacMovableModalDialog ,


MacRadioButton , MacCheckbox

Page 370
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d o a c t i o n o f M a c B u t t o n

MacCheckBox
(a CheckBox, MacWidget)

This is the Macintosh standard version of SK8's CheckBox . In fact, the only real difference between it
and SK8's version is the check color (in this case, black instead of red.) It is used to represent any binary
choice.
A MacCheckBox is a Label whose text is offseted to the right a sufficient number of pixels to leave
space for the CheckBoxCheck : a rectangle with an “X” rendered inside. The MacCheckBox's
mouseSensitivity is 'opaque' , thus clicking anywhere on it checks or unchecks it.

Note: The MacCheckBox assumes that the first item in its contents is a CheckBoxCheck .◆

See Also
CheckBox , MacWidget , MacDialog , MacModalDialog , MacMovableModalDialog ,
MacRadioButton , MacButton

Properties of MacCheckBox

Handlers of MacCheckBox

MacDialog
(a Rectangle, MacWidget)

This is the parent object of the Macintosh Look & Feel dialog boxes, which include the
MacModalDialog , the MacMovableModalDialog , and the MacAlertBox .

This object comes ready-made with 2 buttons: "OK", and "Cancel". When the "Cancel" MacButton is
clicked, the dialog hides itself. Also, when the MacDialog or any of its children is resized, the buttons
stay in the same place, relative to the lower right corner, as specified in the Macintosh Human Interface
Guidelines.

Page 371
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e s i z e d o f M a c D i a l o g

See Also
MacWidget , MacModalDialog , MacMovableModalDialog , MacAlertBox , MacButton ,
MacCheckBox , MacRadioButton , MacProgressIndicator, MacScrollingList

Handlers of MacDialog

resized of MacDialog
resized me
This handler is internal to the MacDialog object, and simply makes sure that the OK and
Cancel buttons, if they exist, stay in the correct place relative to the lower right hand
corner, as specified in the Macintosh Human Interface Guidelines.
If you have a dialog shaped differently than the standard dialog, you'll need to override
this handler.

MacFinderArrow
(a Rectangle, MacWidget)

The MacFinderArrow is the interface element that you'll find in the list view of folders in the finder; it
allows hierarchical views of nested folders in a single window.
The SK8 version is somewhat more simple: right now, it only mimics the behavior of the actual arrow,
without affecting things like folder views. In other words, if the arrow is in a closed state (i.e. pointing to
the right), and a user clicks on it, it highlights, animates to the open state (i.e. pointing down), and
unhighlights.
To find out which state the arrow is in, you should look at its state property.

See Also
MacWidgets

Page 372
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s t a t e o f M a c F i n d e r A r r o w

Properties of MacFinderArrow

state of MacFinderArrow
This property contains the state of the MacFinderArrow. A 'closed' state indicates
that the arrow is currently pointing to the right (which in the Finder means that the folder
is closed), while an 'open' state means that the arrow is pointing down.

Getter
get the state of me

me (a MacFinderArrow)

Setter
set the state of me
to NewValue

me (a MacFinderArrow)
to: One of 'closed' or 'open' .

Handlers of MacFinderArrow

animate of MacFinderArrow
animate me
This handler checks to see if the MacFinderArrow is in a 'closed' state or an 'open'
state, then animates the arrow to be in the other state, whereupon it changes its state
property to reflect the new value.

me (a MacFinderArrow)

mousedown of MacFinderArrow
mouseDown me

Page 373
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o u s e d o w n o f M a c F i n d e r A r r o w

On receiving a mousedown event, a MacFinderArrow will make sure that, as long as the
mouse button is down, that it will be highlighted while the cursor is over its active
arrow, and unhighlighted when it is not. Once the user lets up on the mouse, if the
cursor is no longer over the active region, the arrow puts itself back into an inactive
state. If, however, the cursor is over the arrow, it will call its animate handler to change
to the other possible state.

me (a MacFinderArrow)

MacMenuItem
(a MenuItem)

This object is a descendant of menuItem , specialized for use in a MacPopupMenu . It is specialized in that
when it is selected, it changes the text of its menu to its own text, in the way that standard Macintosh
popups work. Beyond that, however, it behaves in exactly the same way that a menuItem would.

See Also
MacPopupMenu , menu , menuitem

MacModalDialog
(a MacDialog)

MacModalDialog is a direct child of MacDialog , and is the Macintosh standard dialog box, complete
with "OK" and "Cancel" buttons.
The only specialization of this object from its parent is that its windowStyle is set to
'doubleEdgeBox' . This, in turn, means that the user is not able to move the dialog, and the only
available actions are to (1) press either button, or (2) go to another application via the Finder menu in the
upper right hand corner of the screen.

See Also
MacWidget , MacDialog , MacMovableModalDialog , MacAlertBox

Page 374
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o u s e d o w n o f M a c F i n d e r A r r o w

MacMovableModalDialog
(a MacDialog)

MacModalDialog is a direct child of MacDialog , and is the Macintosh standard dialog box, complete
with "OK" and "Cancel" buttons.
The only specialization of this object from its parent is that its windowStyle is set to
'movableDialog' . This, in turn, means that, while the user can move the dialog box around the screen
by dragging on its title bar, the only other available actions are (1) to press either button in the dialog, or
(2) to switch to another application, via the Finder menu in the upper right hand corner of the screen.

See Also
MacWidget , MacDialog , MacModalDialog , MacAlertBox

MacPopupMenu
(a Rectangle, MacWidget)

The MacPopupMenu object is a menu with 3 default items that has a text title, along with a SK8 menu
object. The behaviors that have been added beyond those of a regular menu are that (1) the current menu
selection always shows in the menu title (as opposed to the text title), and (2) when the user
mouseDowns on the MacPopupMenu , the current selection is automatically checked.
In order to affect the actual menu, you should use the MacPopupMenu 's menu property, which acts just
like a SK8 Menu , except that when you add items to the menu, they should be descendants of the
MacMenuItem object.

MacProgressIndicator
(a Rectangle, MacWidget)

This is the definite progress indicator which you can find in the Finder dialog which appears when you
copy files from one place to another.
It is composed of a long, thin rectangle (horizontally oriented) that starts out as a blue color. As more of
an action is completed, the rectangle starts changing to a gray color, from the left hand side, sort of like a
thermometer rising.

Page 375
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p e r c e n t D o n e o f M a c P r o g r e s s I n d i c a t o r

See Also
MacWidget , MacBarberPole , MacRoundIndicator

Properties of MacProgressIndicator

percentDone of MacProgressIndicator
This property affects what percentage of the indicator is gray (from the left), and what
percentage remains blue, as a float divided by 100. That is, if you want to set the indicator
to be half done, you should do: set myIndicator's percentDone to 50 .

Getter
get the percentdone of me

me (a MacProgressIndicator)

Setter
set the percentdone of me
with drawsmooth
with force
to NewValue

me (a MacProgressIndicator)
to: This should be any number between 0 and 100, inclusive.
[with drawSmooth]: Boolean. True indicates that you'd like the value of the
indicator should change by animating from its current value to the new
value. False means that you'd like it to change instantly.
[with force]: Boolean. This was included as an option for internal use
only--it is set to true if the indicator gets resized , so that the
resized handler can call the set percentDone handler to have
the update draw correctly.

Page 376
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e s i z e d o f M a c P r o g r e s s I n d i c a t o r

Handlers of MacProgressIndicator

resized of MacProgressIndicator
resized me
This handler just makes sure that the gray and blue parts of the
MacProgressIndicator stay in the same proportions when the indicator is resized .

MacRadioButton
(a RadioButton, MacWidget)

This object is EXACTLY like SK8's version, which is called RadioButton , and complies with the
Macintosh Interface Guidlines.
RadioButtons are a group of mutually exclusively selectable buttons: clicking on one button will unhilite
the others.
In SK8, RadioButtons are "clustered" together by putting them into a container. Once clustered, selecting
one radio button will deselect all other buttons in the cluster (its container).
A MacRadioButton is a Label whose text is offseted to the right a sufficient number of pixels to leave
space for the RadioButtonButton : an oval with another oval inside of it. The MacRadioButton's
mouseSensitivity is 'opaque' , thus clicking anywhere on it checks or unchecks it.

See Also
MacWidget , MacDialog , MacModalDialog , MacMovableModalDialog , MacButton , MacCheckbox

Page 377
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e s i z e d o f M a c P r o g r e s s I n d i c a t o r

Properties of MacRadioButton

Handlers of MacRadioButton

MacRoundIndicator
(a MacAnimation)

This is the indefinite progress indicator which you can find in many Finder dialogs, specifically the
System 7.5 version of Find and inside network Catalogs. It looks like two curved arrows chasing each
other in a circle, and is generally used to denote that something is happening over the network.

See Also
MacWidget , MacBarberPole , MacAnimation

MacScrollBar
(a Scroller, MacWidget)

The MacScrollBar is exactly the same as a scrollbar that you'd find on the right hand side and along
the bottom of many documents that you'd edit every day. It inherits much of its behavior from the
scroller object, but behaves in a way consistent with the Macintosh Human Interface Guidelines. Any
object in SK8 which uses a scroller may use a MacScrollBar in its place with no modification
(except for actually switching them and making sure that the same ports are wired together).
The space between the scroller's arrows represents the valid range, and the position of the thumb's top
edge in it represents the selected value which we call the currentValue . The currentValue can be
changed by dragging the thumb and clicking on the arrows or the body of the scroller.
The most common use of scrollers is to allow the scrolling of text in EditText fields or the items of a
picker. In this latter case, the range of the scroller is the number of items in the picker. To hook up the
scroller and the picker, you just need to make sure that each time the currentValue of the scroller
changes, the picker's verticalScroll property is set to it. This can be done using ports as illustrated
in the partnerScroller property of Picker.

Page 378
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i s A c t i v e o f M a c S c r o l l B a r

See Also
MacWidget , MacScrollingList

Properties of MacScrollBar

isActive of MacScrollBar
This property should be set to true whenever the window that the MacScrollBar is
connected to is the currently active window, and false if it is in the background. Setting
this property to false will cause all of the contents of the MacScrollBar to be hidden,
thus making it a white rectangle surrounded by a black frame.

Setter
set the isactive of me
to NewValue

isEnabled of MacScrollBar
This property should be set to true when the scrollee is, in fact, scrollable, and false if it
is not. For example, in many text editors, if the total amount of text is less than is visible in
one screenfull, the scrollers are disabled, since there is no need to be able to scroll through
the document. When a scrollbar is disabled, the renderers for the arrows turns into an
outline of an arrow, the body and thumb disappear, and the MacScrollbar no longer
responds to any mouse clicks.

Getter
get the isenabled of me

Setter
set the isenabled of me
to NewValue

shadow of MacScrollBar
This is just a transparent rectangle with a black frame that gets dragged around when the
user drags the thumb of the MacScrollBar.

Page 379
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i t e m s o f M a c S c r o l l i n g L i s t

Getter
get the shadow of me

Setter
set the shadow of me
to NewValue

Handlers of MacScrollBar

MacScrollingList
(a Rectangle, MacWidget)

A MacScrollingList is essentially the Macintosh Look & Feel version of a SK8 picker. It consists of a
rectangle which contains a MacScrollingListText, which is a picker (on the left) and a MacScrollBar
on the right.
You can set the items in the list by using the set items handler, and the rest of the protocol is the same
as a SK8 picker, applied to the textList of the MacScrollingList .

Example
set the items of myScrollingList to the knownChildren of RGBColor

See Also
MacWidget , MacScrollBar, picker

Properties of MacScrollingList

items of MacScrollingList
Specifies the items that the MacScrollingList displays. Note that what appears in the
MacScrollingList is not the item itself but a textual representation of it. This representation
is created by calling the createTextDisplayItem handler on each item. The default
handler uses the objectString of each item.

Page 380
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e s i z e d o f M a c S c r o l l i n g L i s t

Getter
get the items of me

me (a MacScrollingList)

Setter
set the items of me
to NewValue

Sets the items of the MacScrollingList Each item occupies one line of the Picker. After the
items have been set the MacScrollingList's scroller is udpated.

me (a MacScrollingList)
to: A list of things.

See Also

objectString , createTextDisplayItem and updatePartnerScroller.

Handlers of MacScrollingList

resized of MacScrollingList
resized me
This handler just makes sure that the scroller of the MacScrollingList is always the
same height as the object, along the right hand border, and that the picker (the text list)
fills up the rest of the space.

MacWidget
(an Object)

MacWidget is the parent of all of the Macintosh Look & Feel interface elements known as MacWidgets.

Page 381
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i s A c t i v e o f M a c W i d g e t

Properties of MacWidget

isActive of MacWidget
Every MacWidget is either active or not at any given time. For different widgets, this
means different things. For inactive buttons, for instance, the text (and outer frame for
default buttons) should be grayed out and the button should not respond to mouse clicks.

Getter
get the isactive of me

Setter
set the isactive of me
to NewValue

Setting isActive to false will cause the textColor to go to GrayTone50 and change
the mouseSensitivity to 'invisible' , while setting it to true will make the
textColor black and make the mouseSensitivty 'normal' .

mask
(an Object)

A mask represents an arbitrary area. Masks can be defined in a variety of ways and can then be
combined with intersection, union and difference functions. Masks can be painted and framed. They are
also used for clipping (restricting drawing to be visible within the mask only). Use masks in conjunction
with pens to write your own renderers.
Note: A mask is a QuickDraw region.◆

See Also
The functions: clipToMask , currentClipToMask , finishNewMask , frameMask ,
maskBoundsRect , maskCopy, maskDifference , maskInset , maskIntersect , paintMask ,
rectToMask .

Page 382
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
M e d i a o f M a s k e d A c t o r

MaskedActor
(an Actor)

An actor designed to process Macintosh-style graphic icons, such as the icons that appear on the Finder's
desktop.
MaskedActors get their geometry and look from a "cicn" resource. The frameRegion of the
maskedActors is empty. Its fillRegion and boundsRegion are obtained from the mask of the
iconRSRC associated to it through the media property.

See Also
media , translucent .

Properties of MaskedActor

Media of MaskedActor
Specifies the iconRSRC object that defines the actor's geometry.
Note: If the media of a maskedActor is False , the maskedActor renders the
ErrorColor in its bounds.◆

Getter
get the Media of me

me (a MaskedActor)

Setter
set the media of me
to NewValue

me (a MaskedActor)
to (an IconRSRC)

Translucent of MaskedActor
This property controls the way the maskedActor computes its fillRegion . When the
translucent is True , the actor's fill becomes the region specified by its media itself.

Page 383
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a k e b o u n d s r e g i o n o f M a s k e d A c t o r

When the translucent is False , the actor's boundsRect becomes the fill region. In
this case, if the icon is not rectangular, the fillcolor of the maskedActor will show in
the remaining area.
Note: Computing the boundsRegion of an oddly-shaped mask can be
processor-intensive, since testing is done for each pixel in the maskedActor rather than
just for a square surrounding the maskedActor. To speed things up, set the translucent
property to False .◆

Getter
get the Translucent of me

me (a MaskedActor)

Setter
set the translucent of me
to NewValue

me (a MaskedActor)
to (a boolean)

Handlers of MaskedActor

makeboundsregion of MaskedActor
makeBoundsRegion me
Copies the maskedActor's fillRegion .

me (a MaskedActor)

See Also

makeFillRegion .

makefillregion of MaskedActor
makeFillRegion me
If the maskedActor's media is valid and the its translucent property is True , the
fillRegion becomes the mask of the actor's media (an iconRSRC ). The mask is scaled

Page 384
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a k e f r a m e r e g i o n o f M a s k e d A c t o r

to the current size of the maskedActor. Otherwise, the fillRegion becomes the actor's
boundsRect .

me (a MaskedActor)

makeframeregion of MaskedActor
makeFrameRegion me
Sets the MaskedActor's frameRegion to the empty region.

me (a MaskedActor)

MaybeOpenProject
(a ConditionResponse)

Invoking this response informs the user that the project file was improperly closed, and provides the
options of cancelling or trying to open it anyway.
The response is invokable if the currentCondition is a ProjectImproperlyClosedError.

See Also
ProjectImproperlyClosedError, ConditionResponse , the Condition System section of the User
Guide's SK8Script Language chapter

Handlers of MaybeOpenProject

invokable of MaybeOpenProject
invokable me
Returns True if the currentCondition is a ProjectImproperlyClosedError.

me (a MaybeOpenProject)

See Also

ProjectImproperlyClosedError, ConditionResponse

Page 385
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n v o k e o f M a y b e O p e n P r o j e c t

invoke of MaybeOpenProject
invoke me
Informs the user that the project file was improperly closed, and provides the options of
cancelling or trying to open it anyway.

me (a MaybeOpenProject)

See Also

ConditionResponse

writeObject of MaybeOpenProject
writeObject me, thestream, rereadably
If rereadably is True , this just does the inherited writeObject behavior.
Otherwise, if the response is invokable, it writes a description of what the
MaybeOpenProject response will do when invoked. If the response is not invokable, it
writes an explanation of why it is not.

me (a MaybeOpenProject)
theStream
rereadably

See Also

ConditionResponse , writeObject of Object

Media
(an Object)

This is the parent of all objects that hold media in a low level format (usually a handle). Includes all the
resource types plus PixelMap , Font and QuickTimeMovie .
Media has properties that allow it to reference the data from wherever it might be stored. The file
property specifies the file in which the real media is to be found. The resourceId property stores the
resource number of the media if it is a resource. If this property is False , it is assumed that the media
lives in the data fork of its file .
The loadMedia handler uses the information stored in the media object to read the data from disk.

Page 386
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
fi l e o f M e d i a

Finally, once the media is read from disk, it is stored (by loadMedia ) in the mediaData property. We do
not go to disk again after this is done. If you want to force a resampling of the media from disk you have
to set the mediaData to False .

See Also
file , resourceId , loadMedia and mediaData .

Properties of Media

file of Media
Stores a file object representing the file where the media's data is stored. This property
defaults to the file of the media's project .

Getter
get the File of me

me (a Media)

Setter
set the file of me
to NewValue

me (a Media)
to (a File): The file where the media's data is to be found.

mediaData of Media
Once the media is read from disk, it is stored (by the loadMedia handler) in the
mediaData property. We do not go to disk again after this is done. If you want to force a
resampling of the media from disk you have to call unloadMedia .
Another good reason to call unloadMedia is to let the system reclaim the memory that
the media is taking. You should only do this if you know that you will not need to use it
again in the near future.

Getter
get the mediaData of me

Page 387
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e s o u r c e I D o f M e d i a

me (a Media)

Setter
set the mediadata of me
to NewValue

me (a Media)
to: A handle or False .

See Also

loadMedia and unloadMedia .

resourceID of Media
Stores the resource number of the media if it is a resource. If this property is False , it is
assumed that the media lives in the data fork of its file .

Getter
get the resourceID of me

me (a Media)

Setter
set the resourceid of me
to NewValue

me (a Media)
to: An Integer or False .

Handlers of Media

displaySample of Media
displaysample me, theactor
This handler is called to display the media in the actor specified in the theActor
argument. The default handler does nothing.

Page 388
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l o a d M e d i a o f M e d i a

me (a Media)
theActor (an Actor)

See Also

displaySample of the knownChildren of Media and the function


showMediaInActor.

loadMedia of Media
loadMedia me
This handler reads in the real data from disk and stores it in the mediaData property of
the media. If the mediaData property already contains a valid handle, this handler just
returns the value of the mediaData property.
Use unloadMedia to let the system reclaim the memory that the media takes when
loaded.

me (a Media)

See Also

mediaData and unloadMedia .

resType of Media
resType me
This handler should be defined for all children of media to return the ostype of the media
in question. For a QDPicture, for example, this handler would return "PICT". The default
handler of Media returns False .

me (a Media)

unloadMedia of Media
unloadMedia me
This handler allows the system to reclaim the memory currently taken by the loaded
media. In the process, the mediaData property is set to False . This handler can also be
used to force the media to be refreshed: the next time it is needed it will be read from disk
again.

me (a Media)

Page 389
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
u n l o a d M e d i a o f M e d i a

See Also

mediaData and loadMedia .

MemHandle
(a ForeignMemory)

A Memory Handle is a reference to a native operating system chunk of memory. It is allocated by


function newMemHandle and freed by disposeMem. When you use foreign (native operating system)
memory, the SK8 memory system can do very little management or safety checking for you. Using
foreign memory is for very advanced users only. Please read the SK8 User Guide chapter "SK8 Foreign
Function and Data Interface" before atempting to use foreign memory as inappropriate use can easily
crash your machine.

See Also
newMemHandle , disposeMem , ForeignMemory

MemoryFullError
(a SystemError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

MemoryManagerError
(a SystemError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

Page 390
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a r r o w c o l o r o f M e n u

MemPointer
(a ForeignMemory)

A Memory Pointer is a reference to a native operating system chunk of memory. It is allocated by


function newMemPointer and freed by disposeMem. When you use foreign (native operating system)
memory, the SK8 memory system can do very little management or safety checking for you. Using
foreign memory is for very advanced users only. Please read the SK8 User Guide chapter "SK8 Foreign
Function and Data Interface" before atempting to use foreign memory as inappropriate use can easily
crash your machine.

See Also
newMemPointer, disposeMem , ForeignMemory

Menu
(a Rectangle, MenuCollection)

A menu combines a SK8 actor with a Macintosh menu object. In the following discussion we refer to the
later as the menu's pop up component.
Menus in SK8 are versatile objects allowing you to place them both in the Macintosh menubar and in the
contents of any actor. Menus change appearance depending on where they are. If they are installed in a
menubar, they look like simple rectangles that pop up a menu when the mouse goes down on them.
When a menu is on its own (attached to an actor) it looks like a pop up menu: it has a drop shadow and
an inverted triangle (the menuArrow).
A menu becomes useful by adding menu items to its menuItems property. You can build hierarchical
menus by adding a descendant of Menu to the menuitems of a menu.

Properties of Menu

arrowcolor of Menu
Specifies the fillcolor of the menu's menuArrow. The arrow is only visible when the menu
is not part of a menubar and is attached to an actor.

Page 391
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a r r o w s i z e o f M e n u

Getter
get the arrowColor of me

me (a Menu)

Setter
set the arrowcolor of me
to NewValue

me (a Menu)
[to]

Example
get the arrowColor of Menu
set the arrowColor of Menu to Renderer

arrowsize of Menu
Determines the size in pixels of the imaginary rectangle that contains the menu's arrow.
The size is stored in the form of a list of two integers: {width, height} .

Getter
get the arrowSize of me

me (a Menu)

Setter
set the arrowsize of me
to NewValue

me (a Menu)
to: The new size specified as a list of two integers.

container of Menu
Menu only redefines the set container handler. For information on container, check
the container handler of Actor.

Page 392
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d e f a u l t m e n u i t e m o f M e n u

Setter
set the container of me
to NewValue

The container property is used to install the menu in an actor, turning it into a pop up
menu. If the menu is already installed in a menubar or a menu, it is removed before being
added to the actor.

Note: To install the menu in a menubar, use the menubar property of the menu. To install
it in another menu, creating a hierarchical menu, use the menu property of the menu.◆

me (a Menu)
to: The new container. An actor, the Stage or False .

See Also

menu , menubar and container of Actor.

defaultmenuitem of Menu
Specifies the the menu item that will be selected by default when the menu is poped up.
What is actually stored in this property is the layer (an integer) of the menu item in
question.

Getter
get the defaultMenuItem of me

me (a Menu)

Setter
set the defaultmenuitem of me
to NewValue

me (a Menu)
to (an Integer): The layer of the menu item desired.

Example
Let's make a menu with three menuitems and make the second one be the default one.
new menu with objectname "MyMenu"
new menuitem with objectname "Mit1" with menu MyMenu
new menuitem with objectname "Mit1" with menu MyMenu

Page 393
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d e p r e s s e d o f M e n u

new menuitem with objectname "Mit1" with menu MyMenu


set the default menuItem of MyMenu to 2
or we could also say:
set the defaultMenuItem of MyMenu to Mit2's layer

depressed of Menu
This property stores whether the menu is currently depressed. The depression would be a
result of the menu's depresses property being True and the user pressing the mouse on
the menu.

Getter
get the depressed of me

me (a Menu)

Setter
set the depressed of me
to NewValue

me (a Menu)
to (a boolean)

depresses of Menu
The depresses property controls whether the menu (when in popup form) gets depressed
when the user presses the mouse on it.

Getter
get the depresses of me

me (a Menu)

Setter
set the depresses of me
to NewValue

me (a Menu)
to (a boolean)

Page 394
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e n a b l e d o f M e n u

enabled of Menu
Specifies whether the menu is enabled. When enabled is set to False , the menu's text is
grayed out, and the menu is not selectable.
When enabled is set to False , the textColor of the menu is saved. When the menu is
next enabled, its textColor is set to the color that was saved.

Getter
get the enabled of me

me (a Menu)

Setter
set the enabled of me
to NewValue

me (a Menu)
to (a boolean)

Example
Often you will want hierarchical menus to be disabled when they have no items
themselves. For this example, we first build a hierarchical menu. We start by building the
main menu. It will be a menu of our friends, sorted by first name.
new menu with objectName "PeopleMenu" with text "Our Friends"
new menuItem with menu PeopleMenu with text "Julio"
new menuItem with menu PeopleMenu with text "Pipo"
new menuItem with menu PeopleMenu with text "Cacho"
Now we add an item for George. But we know more than one! We'll make this item a
menu and add the surnames as items of it.
new menu with objectname "Georges" with menu PeopleMenu with text
"George"
And add to it the few people named George than we know...
new menuItem with menu Georges with text "Smith"
new menuItem with menu Georges with text "Jones"
And now we get to the point of the example. If there are no items in this hierarchical
menu we want the menu to be disabled. For that we write the update handler as follows:

Page 395
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
fi t t o t e x t o f M e n u

on update of me (a Georges)
if my menuItems = False then
set my enabled to False
else
set my enabled to True
end if
end update

See Also

update , textColor.

fittotext of Menu
This property, which only affects the menu while in its pop up menu form, makes sure the
menu always is large enough to show all its text. This means that the menu acts like a
Label always changing size when its text changes.

Getter
get the fitToText of me

me (a Menu)

Setter
set the fittotext of me
to NewValue

me (a Menu)
to (a boolean)

hspace of Menu
Controls the left of the menu's shadow, letting you control the width of the menu's
shadow (when in pop up form). The default is 2 pixels.

Getter
get the hSpace of me

me (a Menu)

Page 396
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l a y e r o f M e n u

Setter
set the hspace of me
to NewValue

me (a Menu)
to (an Integer)

See Also

vspace .

layer of Menu
This controls the layering of the menu in a menubar, 1 being the number of the frontmost
menu.

Getter
get the layer of me

me (a Menu)

Setter
set the layer of me
to NewValue

me (a Menu)
to (an Integer): A positive integer specifying the new layer.

Menu of Menu
Specifies whether this menu is part of another menu's menuitems . In such a case, this
menu becomes a hierarchical menu of its menu.
Note: A menu can only be installed in one thing at a time: either a
menubar or a menu but not both. So, although a menubar property
is also available (in addition to the menu property), only one of
these properties can be non False at any time.

Getter
get the Menu of me

me (a Menu)

Page 397
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
M e n u B a r o f M e n u

Setter
set the menu of me
with following
to NewValue

me (a Menu)
[with following]: If provided, this argument should specify an item in the
menu's menuitems . This menu will be placed in the following layer.
to: A menu or False , to disociate this menu from its current menu.

MenuBar of Menu
Specifies the menubar the menu is installed in (if any).

Getter
get the MenuBar of me

me (a Menu)

Setter
set the menubar of me
with following
with listupdate
to NewValue

Associates a menu to a menubar. Setting the menubar causes the menu's container to be
set to the menubar (thus removing the menu from any previous container).

me (a Menu)
[with following]: If provided, this argument should specify an item in the
menubar's menus . This menu will be placed in the following layer.
[with listupdate]
to: The menubar to attach this menu to, or False if the menu is to be
removed from its present menubar.

menufillcolor of Menu
This property controls the fillcolor of the menu's pop up component. If the
menuFillColor is False , the menu's fillcolor is used to color the menuitems. You
can only set this property to an RGBColor.

Page 398
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m e n u t e x t c o l o r o f M e n u

Note: the reason of being of this property is to allow you to use two different colors for
the actor part of the menu and the pop up menu part. In most cases these two colors will
be the same, in which case this property would be set to False . ◆

Getter
get the menuFillColor of me

me (a Menu)

Setter
set the menufillcolor of me
to NewValue

me (a Menu)
to (an RGBColor)

menutextcolor of Menu
This property controls the textcolor of the menu's menuitems. If the menuTextColor of a
menu is False , the menu's textColor is used. You can only set this property to an
RGBColor.

Note: the reason of being of this property is to allow you to use two different colors for
the actor part of the menu and the pop up menu part. In most cases these two colors will
be the same, in which case this property would be set to False . ◆

Getter
get the menuTextColor of me

me (a Menu)

Setter
set the menutextcolor of me
to NewValue

me (a Menu)
to (an RGBColor)

Page 399
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m e n u t y p e o f M e n u

menutype of Menu
This handler returns 'popUp' if the menu is currently in its pop up form and 'menu' if the
menu is currently installed in a menubar. Use this handler to find out the state of your
menu.

Getter
get the menuType of me

me (a Menu)

Setter
set the menutype of me
to NewValue

Do not set this property directly: this is done automatically when the menu gets installed
in menubars, menus or actors.

me (a Menu)
to

Text of Menu
Menu redefines the set text handler only. For more on the text property, see the text
of Actor.

Setter
set the text of me
to NewValue

Sets the text and then makes sure the menu is wide enough to show it in its entirety. If
the menu is installed in a menubar, the computeSize handler of the menubar is called to
rearrange the other menus to avoid having them running into each other.

me (a Menu)
to (a String)

See Also

computeSize of Menubar and text of Actor.

Page 400
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t e x t f o n t o f M e n u

textfont of Menu
Menu redefines the set textFont handler only. For more on the textFont property,
see the textFont of Actor.

Setter
set the textfont of me
to NewValue

Sets the textFont and then makes sure the menu is wide enough to show it in its
entirety. If the menu is installed in a menubar, the computeSize handler of the menubar
is called to rearrange the other menus to avoid having them running into each other.

me (a Menu)
[to]

See Also

textFont of Actor and computeSize of Menubar.

textlocation of Menu
Menu redefines the set textlocation handler only. For more on the textlocation
property, see the textlocation of Actor.

Setter
set the textlocation of me
to NewValue

Sets the textlocation and then makes sure the menu is wide enough to show it in its
entirety. If the menu is installed in a menubar, the computeSize handler of the menubar
is called to rearrange the other menus to avoid having them running into each other.

me (a Menu)
to: The new textLocation. One of 'topLeft' , 'topRight' , 'topCenter' ,
'centerLeft' , 'centerRight' , 'center' , 'bottomLeft' ,
'bottomRight' , 'bottomCenter' .

See Also

textLocation of Actor and computeSize of Menubar.

Page 401
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t e x t s i z e o f M e n u

textsize of Menu
Menu redefines the set textSize handler only. For more on the textSize property,
see the textSize of Actor.

Setter
set the textsize of me
to NewValue

Sets the textSize and then makes sure the menu is wide enough to show it in its
entirety. If the menu is installed in a menubar, the computeSize handler of the menubar
is called to rearrange the other menus to avoid having them running into each other.

me (a Menu)
to (an Integer): The new textSize.

See Also

textSize of Actor and computeSize of Menubar.

vspace of Menu
Controls the top of the menu's shadow, letting you control the height of the menu's
shadow The default is 2 pixels.

Getter
get the vSpace of me

me (a Menu)

Setter
set the vspace of me
to NewValue

me (a Menu)
to (an Integer)

See Also

hspace .

Page 402
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b r i n g c l o s e r o f M e n u

Handlers of Menu

bringcloser of Menu
bringCloser me
If the menu is installed in a menubar or menu, it is moved one step closer to the front (the
“front” of a menubar is its left, and the “front” of a menu is its top).
If the menu is installed in an actor, it is brought closer to the front in the actor's contents.

me (a Menu)

See Also

bringCloser of Actor.

bringtofront of Menu
bringToFront me
If the menu is installed in a menubar or menu, it is moved to the front (note that the
“front” of a menubar is its left, and the “front” of a menu is its top).
If the menu is installed in an actor, it is brought to the front in the actor's contents.

me (a Menu)

See Also

bringToFront of Actor.

discard of Menu
discard me
Removes the menu from wherever it is installed in and does the inherited handler to add
it to the recycled list.

me (a Menu)

See Also

discard of Object .

Page 403
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n i t i a l i z e o f M e n u

initialize of Menu
initialize me, original, isnew, initargs
Calls the inherited handler to actually create the menu. Then it copies all the menu items
of the original and installs them in the new menu.

me (a Menu)
original
child
args

installed of Menu
installed me
Returns True if me (a menu) is installed in either a menubar or another menu.

me (a Menu)

localVirtualProperties of Menu
localVirtualProperties me
Returns the virtual properties that the Menu object defines.

me (a Menu)

See Also

virtualProperties of Object .

menuenter of Menu
menuEnter me
Handles mouse tracking in a menu. This is called by the MenuSelectMode when it is the
active event mode, the mouse is down and within the bounds of the menu.

me (a Menu)

See Also

MenuSelectMode .

Page 404
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m e n u i t e m s o f M e n u

menuitems of Menu
menuItems me
Returns the menuItems of the menu. Setting this property removes all the menuItems of
the menu and installs the new ones.

me (a Menu)

menuselect of Menu
menuSelect me
This handler is called by the menuSelect handler of an item in the menu's menuitems
when it is selected. This handler in turn, propagates the event to the menubar it is
installed in (if any).
Note: If this is to be called, make sure all your menuSelect methods on the menuItems
of the menu do inherited .◆

me (a Menu)

menusiblings of Menu
menuSiblings me
Returns all the menus or menuItems that are installed in the menubar or menu where the
menu is installed (including the menu itself).

me (a Menu)

menusize of Menu
menuSize me
Returns a list of two numbers: the width and height of the menu rectangle as it would be
when poped up (this is the size of the Macintosh part of the menu).

me (a Menu)

menutextsize of Menu
menuTextSize me
Return a list with the width and height of the menu would need to have in order to show
all its text when in pop up form.

Page 405
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p r e s e r v e o f M e n u

me (a Menu)

preserve of Menu
preserve me
Prepares the menu for the BuildStandAlone process.

me (a Menu)

See Also

The function BuildStandalone .

resizetotext of Menu
resizeToText me
Changes the size of the menu to ensure that all its text is visible (when the menu is in its
pop up form).

me (a Menu)

Example
Here is the handler as it is defined in the system:
on resizeToText of me (a Menu)
set {w,h} to my menuTextsize
setSize me, w, h
end resizeToText

See Also

menuTextSize .

restore of Menu
restore me
System event. Called when the menu must be restored from its disk format to its memory
format when SK8 loads.

me (a Menu)

Page 406
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e l e c t f r o m m e n u o f M e n u

See Also

The function BuildStandAlone .

selectfrommenu of Menu
selectFromMenu me
with h
with v
with milliseconddelay
with relativeactor
with position
with defaultmenuitem
This handler is used to pop up a menu. This usually happens when a mouseDown event
occurs on a menuBar or a popUp menu, but you can call it anywhere in your code.
Several options are provided to control the location and appearance of the menu. Notice
that if neither the relativeActor nor the coordinates are provided, the menu will
appear at {0,0} , that is, the topLeft corner of your main monitor.
There are two ways of specifying where the menu will show up: you can provide the h
and v coordinates or you can provide a relativeActor.
If the relativeActor argument is not False , the menu comes up on the actor.
You can control the exact location of the menu using the position argument. Four locations
are predefined, corresponding to the four corners of the relativeActor's boundsRect. The
fifth location, the 'mouseLoc', pops up the menu exactly where the pointer is.

me (a Menu)
[with h]: The horizontal position (in Stage coordinates) at which the menu
will be poped up. Defaults to 0.
[with v]: The vertical position (in Stage coordinates) at which the menu will
be poped up. Defaults to 0.
[with milliseconddelay]: If specified, the system waits the required number
of miliseconds before poping up the menu.
[with relativeactor]: If specified should be an actor on the Stage . The menu
will be poped up in a position relative to this actor using the position
argument.
[with position]: How the menu will be placed in relation to its relative actor.
Options are: 'topleft' , 'topright' , 'bottomLeft' ,
'bottomRight' , 'mouseloc' and 'bottomRightAligned' .
[with defaultmenuitem]: The menu item to be selected by default when the
menu is poped up. Defaults to the menu's defaultMenuItem .

sendfarther of Menu
sendFarther me

Page 407
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e n d t o b a c k o f M e n u

If the menu is installed in a menubar or another menu, it is moved one step closer to the
back of the menubar (note that the “back” of a menubar is its right, and the “back” of a
menu is its bottom).
If the menu is installed in an actor, it is sent closer to the back in the actor's contents.

me (a Menu)

See Also

sendFarther of Actor.

sendtoback of Menu
sendToBack me
If the menu is installed in a menubar or another menu, it is moved to the back of the
menubar (note that the “back” of a menubar is its right, and the “back” of a menu is its
bottom).
If the menu is installed in an actor, it is sent to the back in the actor's contents.

me (a Menu)

See Also

sendToBack of Actor.

update of Menu
update me
This handler is called just before the menu is popped up in order to update it and its
menuItems . This is useful to change the text and enabled status of the menu and its
menuItems to reflect the current context.
Note: The default update handler for Menu , calls update on all the menu's menuItems .
Thus, if you redefine this handler and want the menuItems to be updated, you should
make sure your handler does the inherited thing.◆

me (a Menu)

MenuBar
(a Rectangle, MenubarCollection)

Page 408
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o n t a i n e r o f M e n u B a r

The menubar is a rectangle that knows how to deal with menus. This involves arranging the menus
within the menubar and pulling them down when the user presses mousedown on them.
It's important to note that the rectangle is only visible when you install the menubar on an actor. The
menus installed in the menubar are also contained by it.
When the menubar is made the menubar of the Stage , the Macintosh menubar is used to display the
menu and thus the rectangle is not visible.

See Also
menus , menubar of the Stage and selectFromMenubar.

Properties of MenuBar

container of MenuBar
Specifies the menubar's container.
Note: the Menubar only redefines the set container handler. See the container
property of Actor for details on this property.◆

Setter
set the container of me
to NewValue

Sets the container of the menubar (which is a Rectangle) to the container specified. If the
menubar is the menubar of the Stage , it ceases to be (we set the menubar of the Stage
to False ).

me (a MenuBar)
to: An Actor or False .

See Also

set container of Actor.

menus of MenuBar
Specifies all the menus installed in the menubar. The list is ordered from left to right.
Note: Although the menus are also contained by the menubar using contents to get the
menus is not advisable since other things can be contained in the menubar as well.◆

Page 409
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o n s t a g e o f M e n u B a r

Getter
get the menus of me

me (a MenuBar)

Setter
set the menus of me
to NewValue

Sets the menus of the Menubar to the menus provided. Any menus previously installed in
the menubar are removed. Then the new menus are added from left to right. Note that the
menus automatically enter the menubar's contents .

me (a MenuBar)
to: A list of menus or False (to clear the current menus).

onstage of MenuBar
Specifies whether the menubar is currently installed on the Macintosh menubar (the
menubar is the menubar of the Stage ).

Getter
get the onStage of me

me (a MenuBar)

Setter
set the onstage of me
to NewValue

This property is automatically maintained by the system. Thus, there is no need to set it
by hand.

me (a MenuBar)
to (a boolean)

See Also

the menubar of the Stage .

Page 410
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
v i s i b l e o f M e n u B a r

visible of MenuBar
Specifies whether the menubar is visible (either when it is the Macintosh menubar or
when it is an actor).

Setter
set the visible of me
to NewValue

If the menubar is installed as the Macintosh menubar, it hides it or shows it. Otherwise it
does the inherited handler to let the menubar be shown or hidden as an actor.

me (a MenuBar)
to (a boolean)

See Also

set visible of Actor.

Handlers of MenuBar

commandkeyevent of MenuBar
commandKeyEvent me, thechar
The commandKeyEvent handler is called when the menubar is the
currentCommandKey of the System and the user presses a character and the command
key.
The default handler searches through all the menuItems in its menus for one whose
commandKey equals the character. The search is done from the leftmost menu to the
rightmost one and from the menuItem at the top of the menu to the bottom one.
If such a menuItem is found, its menuSelect handler is called. Otherwise, the event is
passed to the Stage , which looks for a matching menuItem, if any, in its menubar.

me (a MenuBar)
thechar: The character pressed in conjunction with the Command key being
down.

See Also

menubar of the Stage and currentCommandKey of the System .

Page 411
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o m p u t e s i z e o f M e n u B a r

computesize of MenuBar
computeSize me
Recomputes the position and size of the menubar's menus . This is performed when a
menu is added or removed, changes ordering within the menubar or its text changes,
among other circumstances.
The default handler runs through the menus from left to right computing the width
required to fit the menu's text and then tiling the menus.

me (a MenuBar)

Example
The handler's text is reproduced for your scripting pleasure.
on computeSize of me (a menubar)
set v to my height
set h to 5
repeat with oneMenu in my menus
set {th,tv} to the actorTextSize of oneMenu with theText
oneMenu's text
set oneMenu's boundsRect to {h, 0, h + th, v}
set x to x + th
end repeat
end computeSize

discard of MenuBar
discard me
If the menubar is the menubar of the Stage , we set the menubar of the Stage to False .
Then the inherited handler gets called to add the menubar to the recycled objects.

me (a MenuBar)

See Also

discard of Object .

installed of MenuBar
installed me
Returns True if the menubar is the menubar of the Stage .

me (a MenuBar)

Page 412
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m e n u s e l e c t o f M e n u B a r

menuselect of MenuBar
menuSelect me
The menuSelect handler of menuItem, which is called on mouseUp , calls menuSelect
on its menu to let it know one of its menu items has been selected. The menu, in turn, calls
the menuSelect handler of its menubar.
Thus, this handler is called on the menubar to let it know that one of its menuItems has
been selected. The default handler does nothing.
Note: If this is to be called, make sure all your menuSelect handlers on menus and
menuItems do the inherited handler.◆

me (a MenuBar)

See Also

menuSelect of menu and menuitem .

mousedown of MenuBar
mouseDown me
Calls selectFromMenubar to get the menus pulled down. Modify this handler if you
want to prevent this behavior.

me (a MenuBar)

See Also

selectFromMenubar.

resized of MenuBar
resized me
The resized handler is called whenever the size of the menubar changes. The default
handler calls computeSize to resize the menus in the menubar.

me (a MenuBar)

See Also

computeSize .

Page 413
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e l e c t f r o m m e n u b a r o f M e n u B a r

selectfrommenubar of MenuBar
selectFromMenubar me
with initialmenu
This handler is called when the user presses the mouse on a menubar. It starts the menu
pull down process. If an initial menu is supplied, it is pulled down first. The menu has to
be a member of the menubar's menus .
Note: This handler returns before the menu selection process is completed. All the work
is done by the special event mode called menuSelectMode which is given control of the
system by this handler. The menuSelectMode yields control as soon as the mouse button
goes up.◆

me (a MenuBar)
[with initialmenu]: The menu to pull down first or False .

See Also

menuSelectMode .

update of MenuBar
update me
The update handler gets called just before the menubar's menus start being pulled down.
The default handler calls the update handler of each of its menus .

me (a MenuBar)

See Also

update of menu and menuItem .

MenubarCollection
(a Collection)

A collection object that is mixed in with Menubar to implement the collection protocol for menubars.

Page 414
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e d i t i n g o f M e n u B a r E d i t o r P i c k e r

MenuBarEditorPicker
(a TablePicker, BrowserComponent, TablePickerEditorAddOn)

This is a component for direct manipulation editing a menubar. It is constructed out of a modified
tablePicker. The menubar being edited is specified by the inputMenubar property. The menus
contained by this menubar are displayed in their appropriate order. This component supports drag and
drop of both menuitems and menus for both adding and reordering menuitems as well as for dropping
menuitems to a particular menu . The user can edit the text of the menuitem by either doubleclicking on
the menu or selecting the menu and pressing return. The currently selected menu is placed in the
outputMenu property on selectionCompleted .

Properties of MenuBarEditorPicker

editing of MenuBarEditorPicker
This property must be set to True to be able to edit any aspect of the menubar.

Getter
get the editing of me

Setter
set the editing of me
to NewValue

inputMenubar of MenuBarEditorPicker
The menubar being edited is specified by this property.

Getter
get the inputMenubar of me

Setter
set the inputmenubar of me
to NewValue

Page 415
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o u t p u t M e n u o f M e n u B a r E d i t o r P i c k e r

me (a MenuBarEditorPicker)
to

outputMenu of MenuBarEditorPicker
The currently selected menu is placed in this property on selectionCompleted .

Getter
get the outputMenu of me

Setter
set the outputmenu of me
to NewValue

Handlers of MenuBarEditorPicker

doubleclick of MenuBarEditorPicker
doubleClick me
Mimics a press of the return key

me (a MenuBarEditorPicker)

dropped of MenuBarEditorPicker
dropped me, droppee
Handle dropping a menu, menuitem, or menubar via the objectDataRect .

me (a MenuBarEditorPicker)
droppee

extendedmousedown of MenuBarEditorPicker
extendedMouseDown me
Describes the behavior of this object when the mouse button has been held down over this
object for and extended period. In this case, drag the ObjectDataRect .

Page 416
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e d i t i n g o f M e n u E d i t o r P i c k e r

me (a MenuBarEditorPicker)

MenuCollection
(a Collection)

A collection object that is mixed in with Menu to implement the collection protocol for menus.

MenuEditorPicker
(a TablePicker, BrowserComponent, TablePickerEditorAddOn,
SelectByRowTablePickerAddOn)

This is a component for direct manipulation editing a menu . It is constructed out of a modified
tablePicker. The menu being edited is specified by the inputMenu property. The menuitems and
submenus contained by this menu are displayed in their appropriate order. This component supports
drag and drop of both menuitems and menus for both adding items as well as for reordering.

Properties of MenuEditorPicker

editing of MenuEditorPicker
This property must be set to True to be able to edit any aspect of the menu .

Getter
get the editing of me

Setter
set the editing of me
to NewValue

Page 417
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n p u t m e n u o f M e n u E d i t o r P i c k e r

inputmenu of MenuEditorPicker
The menu being edited is specified by this property.

Getter
get the inputMenu of me

Setter
set the inputmenu of me
to NewValue

me (a MenuEditorPicker)
to

outputMenuitem of MenuEditorPicker
The currently selected menuitem is placed in this property on selectionCompleted .

Getter
get the outputMenuitem of me

Setter
set the outputmenuitem of me
to NewValue

Handlers of MenuEditorPicker

dropped of MenuEditorPicker
dropped me, droppee
Handles dropping a MenuItem or a Menu via the objectDataRect .

me (a MenuEditorPicker)
droppee

escapeaction of MenuEditorPicker
escapeAction me

Page 418
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e x t e n d e d M o u s e D o w n o f M e n u E d i t o r P i c k e r

The default action is to do nothing.

me (a MenuEditorPicker)

extendedMouseDown of MenuEditorPicker
extendedMouseDown me
Describes the behavior of this object when the mouse button has been held down over this
object for and extended period. In this case, drag the ObjectDataRect with it's object
property set to the selected items.

me (a MenuEditorPicker)

resized of MenuEditorPicker
resized me
This makes sure the columns of the tablePicker are resized properly.

me (a MenuEditorPicker)

MenuForConPickers
(a PDPMenu)

This is the menu used for Constants Pickers.


The menu contains two items. The first is an "Add Constant" item which brings up the
addConstantDialog on the inputproject of the picker. The second is a "Remove Constant" item which
brings up the removeConstantDialog on the selected item in the picker (if it is a Constant) for the
inputproject of the picker.

MenuForFunPickers
(a PDPMenu)

This is the menu used for Function Pickers.

Page 419
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
B r o w s e r C o m p o n e n t o f M e n u F o r H a n d l e r P i c k e r s

The menu contains two items. The first is an "Add Function " item which brings up the
addFunctionDialog on the inputproject of the picker. The second is a "Remove Handler " item which
brings up the removefunctionDialog on the selected item in the picker (if it is a function) for the
inputproject of the picker.

MenuForHandlerPickers
(a Menu)

This is the menu used for Handler Pickers, e.g. the "Handlers" menu in the System Browser, and along
with the menuForPropertyPickers is what is returned when getting the menuprototype of the
MixinForPropertyHandlerPickers.
The menu contains two items. The first is an "Add Handler " item which brings up the
addHandlerDialog on the inputobjects of the picker. The second is a "Remove Handler " item which
brings up the removeHandlerDialog on the selected item in the picker (if it is a handler) for the
inputobjects of the picker.

Properties of MenuForHandlerPickers

BrowserComponent of MenuForHandlerPickers
This property is set to the browsercomponent associated with this menuitem. It is set by
Setup of BrowserMenubar. This must be set so the menu knows where to look to see what
items are selected.
Note that if you wish to make a new menu for a browser component, you should add the
Browsercomponent property as well.

Getter
get the BrowserComponent of me

Setter
set the browsercomponent of me
to NewValue

Page 420
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
u p d a t e o f M e n u F o r H a n d l e r P i c k e r s

Handlers of MenuForHandlerPickers

update of MenuForHandlerPickers
update me
This updates the text of the menu items to reflect the currently selected items in the picker.

me (a MenuForHandlerPickers)

MenuForHierarchicalObjectPickers
(a MenuForObjectPickers)

This is the menuprototype for Hierachical Object Pickers. It contains three sets of items. The first set is
the same as the first two of the MenuForObjectPickers which allow object creation and clearing. The
second set let the user specify the relation being viewed in the hierarchical picker. The final menu item
controls whether or not swatches are shown. Note that by default hiding or showing swatches will do
nothing unless you provide some structure for how these swatches are generated. See the hierarchical
picker for more details.

MenuForMenuEditorPickers
(a Menu)

This is the menuprototype for Menu Editor Pickers, e.g. the "Menu Items" menu in the Menu Builder. It
contains five items. The first is a "New" item which lets the user create a new menuitem. The second is a
"Clear References" items which lets the user clear away all standard references to the currently selected
menuitem(s). The third is a spacer. The fourth lets you edit the update handler for the currently selected
menuitem. The fifth lets you edit the menuselect handler for the currently selected menuitem.

Page 421
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
B r o w s e r C o m p o n e n t o f M e n u F o r M e n u E d i t o r P i c k e r s

Properties of MenuForMenuEditorPickers

BrowserComponent of MenuForMenuEditorPickers
This property is set to the browsercomponent associated with this menuitem. It is set by
Setup of BrowserMenubar. This must be set so the menu knows where to look to see what
items are selected.
Note that if you wish to make a new menu for a browser component, you should add the
Browsercomponent property as well.

Getter
get the BrowserComponent of me

Setter
set the browsercomponent of me
to NewValue

menuitemprototype of MenuForMenuEditorPickers
This property describes the child of MenuItem to use when the user chooses "New
MenuItem" from the menu. By default, it is set to MenuItem .

Getter
get the menuItemPrototype of me

Setter
set the menuitemprototype of me
to NewValue

Handlers of MenuForMenuEditorPickers

update of MenuForMenuEditorPickers
update me
This updates the text of the menu items to reflect the currently selected items in the picker.

Page 422
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
B r o w s e r C o m p o n e n t o f
M e n u F o r O b j e c t P i c k e r s

me (a MenuForMenuEditorPickers)

MenuForObjectPickers
(a Menu)

This is the menuprototype for Object Pickers, e.g. the "Objects" menu in the System Browser. It contains
two items. The first is a "New" item which lets the user create a new object. The second is a "Clear
References" items which lets the user clear away all standard references to the currently selected object(s).

Properties of MenuForObjectPickers

BrowserComponent of MenuForObjectPickers
This property is set to the browsercomponent associated with this menuitem. It is set by
Setup of BrowserMenubar. This must be set so the menu knows where to look to see what
items are selected.
Note that if you wish to make a new menu for a browser component, you should add the
Browsercomponent property as well.

Getter
get the BrowserComponent of me

Setter
set the browsercomponent of me
to NewValue

Handlers of MenuForObjectPickers

update of MenuForObjectPickers
update me

Page 423
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
B r o w s e r C o m p o n e n t o f M e n u F o r P r o p e r t y P i c k e r s

This updates the text of the menu items to reflect the currently selected items in the picker.

me (a MenuForObjectPickers)

MenuForPropertyPickers
(a Menu)

This is the menu used for Property Pickers, e.g. the "Properties" menu in the System Browser, and along
with the menuForHandlerPickers is what is returned when getting the menuprototype of the
MixinForPropertyHandlerPickers.
The menu contains two items. The first is an "Add Property" item which brings up the
addPropertyDialog on the inputobjects of the picker. The second is a "Remove Property" item which
brings up the removePropertyDialog on the selected item in the picker (if it is a property) for the
inputobjects of the picker.

Properties of MenuForPropertyPickers

BrowserComponent of MenuForPropertyPickers
This property is set to the browsercomponent associated with this menuitem. It is set by
Setup of BrowserMenubar. This must be set so the menu knows where to look to see what
items are selected.
Note that if you wish to make a new menu for a browser component, you should add the
Browsercomponent property as well.

Getter
get the BrowserComponent of me

Setter
set the browsercomponent of me
to NewValue

Page 424
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
u p d a t e o f M e n u F o r P r o p e r t y P i c k e r s

Handlers of MenuForPropertyPickers

update of MenuForPropertyPickers
update me
This updates the text of the menu items to reflect the currently selected items in the picker.

me (a MenuForPropertyPickers)

MenuForValueEditorPickers
(a Menu)

This is the menuprototype for Object Pickers, e.g. the "Values" menu in the System Browser. It contains
two items. The first is a "Add Value to List" item which lets the user insert an item into the list that is
being edited (note that in the case of knownchildren this will create a new object). The second is a
"Remove Value from List" item which will let the user take away a value from the list in the property
(note in the case of knownchildren, this will let the user clear away all standard references to the
currently selected object).

Properties of MenuForValueEditorPickers

BrowserComponent of MenuForValueEditorPickers
This property is set to the browsercomponent associated with this menuitem. It is set by
Setup of BrowserMenubar. This must be set so the menu knows where to look to see what
items are selected.
Note that if you wish to make a new menu for a browser component, you should add the
Browsercomponent property as well.

Getter
get the BrowserComponent of me

Page 425
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
u p d a t e o f M e n u F o r Va l u e E d i t o r P i c k e r s

Setter
set the browsercomponent of me
to NewValue

Handlers of MenuForValueEditorPickers

update of MenuForValueEditorPickers
update me
This updates the text of the menu items to reflect the currently selected items in the picker.

me (a MenuForValueEditorPickers)

MenuForVarPickers
(a PDPMenu)

This is the menu used for Variable Pickers.


The menu contains two items. The first is an "Add Variable" item which brings up the addVariableDialog
on the inputproject of the picker. The second is a "Remove Variable" item which brings up the
removeVariableDialog on the selected item in the picker (if it is a Variable) for the inputproject of the
picker.

MenuItem
(a Graphic)

The menuItem is the simplest menu element. The menuitem contains the following parts:
text (the title of the menuItem)

commandKey (the character that selects the menuItem when pressed in conjunction with the command
key)
checkmark (a symbol commonly used to indicate the menu has been selected).

Page 426
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c h e c k c o l o r o f M e n u I t e m

You can only install menuItems in menus and change a few attributes, such as the text and enabled
status. The menuSelect handler of menuItem is used to provide your menus with the required
functionality.

Properties of MenuItem

checkcolor of MenuItem
Specifies the color of the check mark or other character signifying an active menuItem.
Note: Only descendants of RGBColor make suitable colors for menus. Other kinds of
renderers are accepted, but they are converted to an RGBColor.◆

Getter
get the checkColor of me

me (a MenuItem)

Setter
set the checkcolor of me
to NewValue

me (a MenuItem)
to (an RGBColor)

checkmark of MenuItem
Specifies the character to be used as the menu item's checkmark, or False if no
checkmark will be used.

Getter
get the checkMark of me

Returns the character currently being used as the menuitem's checkmark.

me (a MenuItem)

Page 427
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o m m a n d k e y o f M e n u I t e m

Setter
set the checkmark of me
to NewValue

me (a MenuItem)
to: Either True , False or a character.

commandkey of MenuItem
A menuItem that has a command key can also be selected by pressing that character in
conjunction with the command key. Setting the commandKey to False (the default) turns
off this capability (for the menu item).
It is common to avoid repetition of the same commandKey within one menu. Note that if
two menuitems in a menu did share commandKeys, the system would always select the
one closest to the front of the menu.

Getter
get the commandKey of me

me (a MenuItem)

Setter
set the commandkey of me
to NewValue

me (a MenuItem)
to: A character of False (no command key equivalent).

See Also

commandKeyEvent of Menubar.

enabled of MenuItem
Specifies whether the menu item is enabled. When enabled is set to False , the Menu
item's title is grayed, and the menu item is not selectable. This property is usually changed
in the menuItem's update handler.

Getter
get the enabled of me

Page 428
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
k e y c o l o r o f M e n u I t e m

me (a MenuItem)

Setter
set the enabled of me
to NewValue

me (a MenuItem)
to (a boolean)

See Also

update .

keycolor of MenuItem
The keyColor property sets the color of the keyboard equivalent of the menuItem (the
commandKey of the item) it any. The default color is black.
Note: Only children of RGBColor make suitable colors for menus. Other kinds of
renderers are accepted, but they are converted to an RGBColor.◆

Getter
get the keyColor of me

me (a MenuItem)

Setter
set the keycolor of me
to NewValue

me (a MenuItem)
to (an RGBColor)

layer of MenuItem
Specifies the order of the menuItem in the menu where it is installed, 1 being the number
of the frontmost menuItem.

Getter
get the layer of me

Page 429
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
M e n u o f M e n u I t e m

me (a MenuItem)

Setter
set the layer of me
to NewValue

It is an error to call this handler when the menuItem is not in a menu. It is also an error to
specify a layer than is greater than the number of menu items in the menuItem's menu .

me (a MenuItem)
to (an Integer): Should be between 1 and the number of menuitems is the
menuitem's menu .

Menu of MenuItem
Specifies the menu this menuitem is installed in. A menuitem can only be visible when
installed in a menu.

Getter
get the Menu of me

me (a MenuItem)

Setter
set the menu of me
to NewValue

Installs the menuItem in the menu specified. If the menu specified is False , this handler
removes the menuItem from its current menu .

me (a MenuItem)
to: A menu or False .

Example
We make a menu and put it on the stage.
new menu with objectname "DemoMenu"
set demoMenu's location to {100,100}
set demoMenu's container to the Stage

Page 430
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
Te x t o f M e n u I t e m

Now we add a menu item to it.


new menuitem with text "Hi there!" with menu DemoMenu
And that's it. Mousing down on the menu now shows our menu item.

See Also

the menuItems property of Menu for another way to install menuItems in a menu.

Text of MenuItem
Specifies the text of the menuItem.

Getter
get the Text of me

me (a MenuItem)

Setter
set the text of me
to NewValue

me (a MenuItem)
to (a String)

textcolor of MenuItem
Specifies the textColor of the text of the specified MenuItem.
Note: Only children of RGBColor make suitable colors for menus. Other kinds of
renderers are accepted, but they are converted to an RGBColor.◆

Getter
get the textColor of me

me (a MenuItem)

Setter
set the textcolor of me
to NewValue

Page 431
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t e x t s t y l e o f M e n u I t e m

me (a MenuItem)
to (an RGBColor)

textstyle of MenuItem
Specifies the textStyle to use to draw the menuitem's text. The textStyle is specified as a
list of styles.

Getter
get the textStyle of me
with num
with start
with end

me (a MenuItem)
[with num]: Ignored.
[with start]: Ignored.
[with end]: Ignored.

Setter
set the textstyle of me
to NewValue

me (a MenuItem)
to: A list of text styles.

Example
We make a menuItem and change its textStyle a couple of times.
new menuItem with objectname "styledItem"
set the textStyle of styledItem to {'bold', 'underline'}
set the textStyle of styledItem to {'plain'}

Handlers of MenuItem

bringcloser of MenuItem
bringCloser me

Page 432
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b r i n g t o f r o n t o f M e n u I t e m

Brings the menuItem one step closer to the front of the menu (the frontmost menu item is
the one at the top of the menu).

me (a MenuItem)

See Also

layer.

bringtofront of MenuItem
bringToFront me
Makes menuItem the frontmost menu item of its menu (the frontmost menu item is the
one at the top of the menu).

me (a MenuItem)

See Also

layer.

discard of MenuItem
discard me
Removes the menuItem from its menu and then calls the inherited discard handler to
add the menuItem to the recycled list.

me (a MenuItem)

See Also

discard of Object .

initialize of MenuItem
initialize me, original, isnew, initargs
Calls the inherited initialize handler and then copies the comandKey, text , and
enabled , properties from the original.

me (a MenuItem)
original
child
args

Page 433
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l o c a l Vi r t u a l P r o p e r t i e s o f M e n u I t e m

localVirtualProperties of MenuItem
localVirtualProperties me
Returns the virtual properties that this object defines.

me (a MenuItem)

See Also

localVirtualProperties of Object .

menuselect of MenuItem
menuSelect me
The menuSelect event is sent by SK8 when the user does a mouseUp on a menuItem.
This is the handler to redefine to add functionality to your menuItem.
The default handler calls menuSelect on its menu .

me (a MenuItem)

Example
Here is a menuItem, called "layerConscious" than beeps when selected.
on menuSelect of me (a LayerConscious)
repeat my layer times
beep
end repeat
end menuSelect

sendfarther of MenuItem
sendFarther me
This sends the menuItem one step closer to the back of its menu (note that the backmost
menuItem is the one at the bottom of the menu).

me (a MenuItem)

See Also

layer.

Page 434
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e n d t o b a c k o f M e n u I t e m

sendtoback of MenuItem
sendToBack me
Makes menuItem the backmost menuItem in its menu (note that the backmost menuItem
is the one at the bottom of the menu).

me (a MenuItem)

See Also

layer.

update of MenuItem
update me
The update handler is called just before the menu that contains the menuItem is popped
up. At this time, the menuItem is given the chance to update itself. This usually entails
changing its text and whether it is enabled to reflect the current context.

me (a MenuItem)

Example
Consider a menuItem that is partial to the color Vomit . This menuItem might perform
some very important function, but will only enable itself when the fillcolor of the
Stage is Vomit .
on udpate of me (a VomitLover)
if the fillcolor of the Stage = Vomit then
set my enabled to true
else
set my enabled to false
end if
end update

MenuManagerError
(a SystemError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

Page 435
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
u p d a t e o f M e n u I t e m

MenuSpacer
(a MenuItem)

A disabled menu item that manifests itself as a dotted line.

Example
Now, you may think this is very cool but all you need to do to make your own version of the
menuSpacer is the following:
new menuItem with objectname "mySpacer"
set the enabled of mySpacer to false
set the text of mySpacer to the character "-"

MinutesClock
(a SlaveClock)

A clock that ticks once for each 60 ticks of its master. Its master is (you guessed it!) the SecondsClock.

See Also
SecondsClock

MixinForObjectPickers
(a BrowserComponent)

This is the abstract object which defines the component behavior for showing a list of objects. This mixin
can be added as a parent to either a picker or a tablePicker It is controlled by it's properties which
are described below.

See Also
inputobjects

Page 436
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n p u t o b j e c t s o f M i x i n F o r O b j e c t P i c k e r s

Properties of MixinForObjectPickers

inputobjects of MixinForObjectPickers
This property specifies the set of objects the picker is to show.

Getter
get the inputObjects of me

Setter
set the inputobjects of me
to NewValue

me (a MixinForObjectPickers)
to

outputobjects of MixinForObjectPickers
This is the set of objects currently selected. Note this supports multiple selection.

Getter
get the outputObjects of me

Setter
set the outputobjects of me
to NewValue

Handlers of MixinForObjectPickers

createtextdisplayitem of MixinForObjectPickers
createTextDisplayItem me, theitem
This calls objectString on the object with the project argument specified by my
targetProject property.

Page 437
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d o u b l e c l i c k o f M i x i n F o r O b j e c t P i c k e r s

me (a MixinForObjectPickers)
theitem

doubleclick of MixinForObjectPickers
doubleClick me
Brings up a script editor if the object is a handler.

me (a MixinForObjectPickers)

dropped of MixinForObjectPickers
dropped me, droppee
Handle dropping a PropertyDataRect , or a HandlerDataRect . In the case of
dropping a property on the object, it either sets the property of the object to the dragged
value if the property is already present in the object. Otherwise, it lets you add that
property to the object.

me (a MixinForObjectPickers)
droppee

extendedmousedown of MixinForObjectPickers
extendedMouseDown me
Describes the behavior of this object when the mouse button has been held down over this
object for and extended period. In this case, drag the selecteditems in the
ObjectDataRect or the HandlerDataRect , whichever is revelent.

me (a MixinForObjectPickers)

keydown of MixinForObjectPickers
keyDown me, thechar
Allows the user to press the delete key to get rid of the selecteditem.

me (a MixinForObjectPickers)
thechar

Page 438
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e l e c t i o n C o m p l e t e d o f
M i x i n F o r O b j e c t P i c k e r s

selectionCompleted of MixinForObjectPickers
selectionCompleted me
Causes the outputobjects property to be set to the selectedItems .

me (a MixinForObjectPickers)

MixinForObjectPiles
(a MixinForObjectPickers)

This is a child of the MixinForObjectPickers which gives additional "pile" functionality. It can be
added as parent to a picker or a tablePicker. As a parent, this allows the user to create a free form
list by dragging objects and handlers into this picker. The user can also reorder the objects by drag and
drop.

Properties of MixinForObjectPiles

editing of MixinForObjectPiles
When this is set to False , the picker will not allow items to be dropped in or
reordered.

Getter
get the editing of me

Setter
set the editing of me
to NewValue

inputobjects of MixinForObjectPiles
This property takes a list which specifies which objects and in what order should be
displayed in the pile.

Page 439
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d r o p p e d o f M i x i n F o r O b j e c t P i l e s

Setter
set the inputobjects of me
to NewValue

me (a MixinForObjectPiles)
to

Handlers of MixinForObjectPiles

dropped of MixinForObjectPiles
dropped me, droppee
Handle dropping a Handlerdatarector, or an ObjectDataRect, onto me. Note that this will
call set inputobjects.

me (a MixinForObjectPiles)
droppee

MixinForProjectDataPickers
(a BrowserComponent)

This is the abstract object which defines the component behavior for showing Project related
information in a picker or a tablePicker. This object can be added as a parent to either a picker or a
table picker in order to display information on the project's functions, constants and variables. It is
controlled by it's properties. In particular it's inputProject property.

See Also
ProjectDataSheet , ProjectDataSheetPicker, FunctionSheet , FunctionSheetPicker,
ConstantSheet , ConstantSheetPicker, VariableSheet , VariableSheetPicker

Page 440
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n p u t P r o j e c t o f
M i x i n F o r P r o j e c t D a t a P i c k e r s

Properties of MixinForProjectDataPickers

inputProject of MixinForProjectDataPickers
This property specifies which project is being edited. Setting this causes the picker to
be updated to display the relevant information regarding this project.

Getter
get the inputProject of me

Setter
set the inputproject of me
to NewValue

outputconstant of MixinForProjectDataPickers
This property is set to the currently selected constant on selectioncompleted . If the
selected item is not a constant, then this is set to False .

Getter
get the outputConstant of me

Setter
set the outputconstant of me
to NewValue

outputFunction of MixinForProjectDataPickers
This property is set to the currently selected function on selectioncompleted . If the
selected item is not a function , then this is set to False .

Getter
get the outputFunction of me

Setter
set the outputfunction of me
to NewValue

Page 441
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o u t p u t Va r i a b l e o f M i x i n F o r P r o j e c t D a t a P i c k e r s

outputVariable of MixinForProjectDataPickers
This property is set to the currently selected variable on selectioncompleted . If the
selected item is not a variable , then this is set to False .

Getter
get the outputVariable of me

Setter
set the outputvariable of me
to NewValue

showsConstants of MixinForProjectDataPickers
This property specifies whether or not you wish the picker to show the constants of the
inputProject . It can be set to either True or False .

Getter
get the showsConstants of me

Setter
set the showsconstants of me
to NewValue

showsFunctions of MixinForProjectDataPickers
This property specifies whether or not you wish the picker to show the functions of the
inputProject It can be set to either True or False .

Getter
get the showsFunctions of me

Setter
set the showsfunctions of me
to NewValue

showsvariables of MixinForProjectDataPickers
This property specifies whether or not you wish the picker to show the variables of the
inputProject . It can be set to either True or False .

Page 442
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d o u b l e c l i c k o f M i x i n F o r P r o j e c t D a t a P i c k e r s

Getter
get the showsVariables of me

Setter
set the showsvariables of me
to NewValue

Handlers of MixinForProjectDataPickers

doubleclick of MixinForProjectDataPickers
doubleClick me
Double click will bring up the proper script editor for the first of the selectedItems if it
is a function .

me (a MixinForProjectDataPickers)

keydown of MixinForProjectDataPickers
keyDown me, thechar
Allows the user to press the delete key to get rid of item 1 of the selecteditems .

me (a MixinForProjectDataPickers)
thechar

MixinForPropertyHandlerPickers
(a BrowserComponent)

This is the abstract object which defines the component behavior for showing the properties and
handlers of a single object or a group of objects in pickers. This mixin can be added as a parent to either
a picker or a tablePicker. It is controlled by it's properties which are described below, namely
inputObjects .

Page 443
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n p u t o b j e c t s o f M i x i n F o r P r o p e r t y H a n d l e r P i c k e r s

See Also
PropertyHandlerPicker, PropertyHandlerSheetPicker

Properties of MixinForPropertyHandlerPickers

inputobjects of MixinForPropertyHandlerPickers
This is the list of objects which the picker is focused on. If it is set to one object then the
properties and handlers for that object are shown accordingly. If it is set to more than one
object, then the intersection of the set of properties for all of these objects is shown. The
union of the set of handlers is shown.

Getter
get the inputObjects of me

Setter
set the inputobjects of me
to NewValue

me (a MixinForPropertyHandlerPickers)
to

outputhandler of MixinForPropertyHandlerPickers
This property is set to the currently selected handler on selectionCompleted . If the
item 1 of the selectedItems is not a handler, then this is set to False .

Getter
get the outputHandler of me

Setter
set the outputhandler of me
to NewValue

Page 444
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o u t p u t o b j e c t s o f
M i x i n F o r P r o p e r t y H a n d l e r P i c k e r s

outputobjects of MixinForPropertyHandlerPickers
This property is set to the value of inputObjects whenever inputobjects is set. It is here
to facilitate data flow to some value editor.

Getter
get the outputObjects of me

Setter
set the outputobjects of me
to NewValue

outputproperty of MixinForPropertyHandlerPickers
This property is set to the currently selected property on selectionCompleted . If the
selected item is not a handler, then this is set to False .

Getter
get the outputProperty of me

Setter
set the outputproperty of me
to NewValue

showshandlers of MixinForPropertyHandlerPickers
This property specifies whether or not you wish the picker to show the handlers of the
input objects. It can be set to either True or False .

Getter
get the showsHandlers of me

Setter
set the showshandlers of me
to NewValue

showsprivates of MixinForPropertyHandlerPickers
This property specifies whether or not you wish the picker to show private properties and
handlers. It can be set to either True or False .

Page 445
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s h o w s p r o p e r t i e s o f
M i x i n F o r P r o p e r t y H a n d l e r P i c k e r s

Getter
get the showsPrivates of me

Setter
set the showsprivates of me
to NewValue

showsproperties of MixinForPropertyHandlerPickers
This property specifies whether or not you wish the picker to show the properties of the
input objects. It can be set to either True or False .

Getter
get the showsProperties of me

Setter
set the showsproperties of me
to NewValue

view of MixinForPropertyHandlerPickers
This determines which set of properties and handlers are shown. It can be set to 'local',
'Parents', 'Inherited', 'Graphic',or 'all'. These values cause only local properties/handlers
to be shown, local properties/handlers and parent's properties/handlers , all inherited
properties/handlers , all properties/handlers inherited from actor, and all properties/
handlers, respectively.

Getter
get the view of me

Setter
set the view of me
to NewValue

Page 446
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c r e a t e t e x t i t e m s t y l e o f
M i x i n F o r P r o p e r t y H a n d l e r P i c k e r s

Handlers of MixinForPropertyHandlerPickers

createtextitemstyle of MixinForPropertyHandlerPickers
createTextItemStyle me, targetitem, thestring, position
This handler causes local properties and handlers displayed in bold. Unsettable
properties are displayed in italics.

me (a MixinForPropertyHandlerPickers)
item
thestring
position

doubleclick of MixinForPropertyHandlerPickers
doubleClick me
Bring up the EditHandlerObjectDialog for the first selected item of me when it's a
handler.

me (a MixinForPropertyHandlerPickers)

dropped of MixinForPropertyHandlerPickers
dropped me, droppee
Handle dropping a ObjectDataRect , PropertyDataRect or a HandlerDataRect .

me (a MixinForPropertyHandlerPickers)
droppee

extendedmousedown of MixinForPropertyHandlerPickers
extendedMouseDown me
Describes the behavior of this object when the mouse button has been held down over this
object for and extended period. In this case, drag the PropertyDataRect or the
HandlerDataRect , whichever is revelent.

me (a MixinForPropertyHandlerPickers)

Page 447
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
k e y d o w n o f M i x i n F o r P r o p e r t y H a n d l e r P i c k e r s

keydown of MixinForPropertyHandlerPickers
keyDown me, thechar
Allows the user to press the delete key to get rid of the selectedItems .

me (a MixinForPropertyHandlerPickers)
thechar

selectioncompleted of MixinForPropertyHandlerPickers
selectionCompleted me
This handler sets the outputProperty and outputHandler.

me (a MixinForPropertyHandlerPickers)

Monitor
(a Device)

Represents a monitor in the current system environment.


There are two ways one can enquire which monitors are currently installed in the operating environment.
One way is to ask the System object for its monitors:
get the monitors of the System
The second way is:
get the knownChildren of Monitor

Example
The following are examples of how you can use the Monitor object:
(1) Ensure that the pixel depth of your main monitor is 8.
if the colorDepth of item 1 in the knownchildren of Monitor ≠ 8 then set the colorDepth of item 1 in the
knownchildren of Monitor to 8
(2) Beep if a monitor doesn't support color.
if myMonitor is color then beep
(3) Get the location of a monitor in relation to the Stage.
get the location of myMonitor
(4) Get the size, in pixels of a monitor. (Size is returns as width and height.)

Page 448
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d a t a o f M o n i t o r

get the size of myMonitor


(5) Get the boundsRect of a monitor in relation to the Stage.
get the boundsRect of myMonitor

Properties of Monitor

data of Monitor

Getter
get the data of me

Setter
set the data of me
to NewValue

Handlers of Monitor

active of Monitor
active me
Predicate returns True if the monitor is active (i.e., is actually turned on).

me (a Monitor)

Example
get active(Monitor)

boundsrect of Monitor
boundsRect me
Returns the boundsRect of the monitor relative to the stage. This property is not settable.

Page 449
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o l o r o f M o n i t o r

me (a Monitor)

Example
get the boundsRect of Monitor

color of Monitor
color me
Predicate returns True if the monitor supports colors (i.e., is not monochrome).

me (a Monitor)

Example
get color(monitor)

colordepth of Monitor
colorDepth me
Sets or returns the monitor's current depth. The allowable depth settings of a monitor are
monitor-specific. This is settable.

me (a Monitor)

Example
get the colorDepth of Monitor
set the colorDepth of Monitor

location of Monitor
location me
Returns the location of the monitor in the stage.

me (a Monitor)

Example
get the location of Monitor

Page 450
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a i n m o n i t o r o f M o n i t o r

mainmonitor of Monitor
mainMonitor me
Predicate returns True when the child of Monitor is the main monitor of the system. The
significance of a main monitor is system environment specific: in the Macintosh, the main
monitor is the monitor with the Macintosh menubar when the system boots.

me (a Monitor)

Example
get mainMonitor(Monitor)

size of Monitor
size me
Returns the size, in pixels, of the monitor.

me (a Monitor)

Example
get the size of Monitor

Mouse
(a Pointer)

This object represents any mouse device connected to the system.


Note: Joysticks and other input devices, when available and supported, are represented by other Device
objects than mouse.◆

Page 451
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d o w n o f M o u s e

Handlers of Mouse

down of Mouse
down me
Returns True if the mouse button is currently down

me (a Mouse)

h of Mouse
h me

me (a Mouse)

location of Mouse
location me

me (a Mouse)

up of Mouse
up me
Returns True if the mouse button is up.

me (a Mouse)

v of Mouse
v me

me (a Mouse)

Page 452
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
v o f M o u s e

MovieControllerError
(a MovieError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

MovieDataHandlerError
(a MovieError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

MovieError
(a SystemError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

MovieRectangle
(a Rectangle)

MovieRectangle is a child of Rectangle with no additional properties. Its initialize handler sets
the new object's fillColor to a new child of QuickTimeRenderer.
After you make a new MovieRectangle , set its fillColor's media to the movie you want or to
True (which will bring up a QuickTime open file dialog).

MovieRectangle is on the standard palette.

Page 453
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
v o f M o u s e

That's all there is to it. This object exists only to provide a shortcut for using QuickTime movies. Another
shortcut is moviefy of Actor.

Example
new MovieParent with objectname "aMovieWindow" with container Stage
set aMovieWindow's fillColor's media to True
start aMovieWindow's fillColor

See Also
QuickTimeMovie , QuickTimeRenderer, moviefy of Actor

Properties of MovieRectangle

Handlers of MovieRectangle

MovieSequenceGrabberError
(a MovieError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

MultiLinePicker
(a StyledPicker)

This is a styledPicker which provides word wrap. Normally in a picker, if an item is too long to fit on
one line, the line is truncated and a "..." is appended to the end. The multilinepicker allows each item to
appear in it's entirety by using multiple lines and word wrapping.
If the item is too long to fit in the number of lines available given the size of the picker, then it is
truncated and a "..." is appended to the end. Thi is done to facilitate keyboard navigation.

Page 454
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d r a w S e p a r a t o r o f M u l t i L i n e P i c k e r

An example of the MultiLinePicker is the picker in the Message Box.

Properties of MultiLinePicker

drawSeparator of MultiLinePicker
This property can be set to True or False . It determines whether or not a line is drawn
between the items. This can be useful if you have small line seperation.

Getter
get the drawSeparator of me

Setter
set the drawseparator of me
to NewValue

lineinfo of MultiLinePicker
This property stores word wrap information for lines which have been displayed. Modify
this property at your own risk!

Getter
get the lineInfo of me

Setter
set the lineinfo of me
to NewValue

Handlers of MultiLinePicker

additems of MultiLinePicker
addItems me, itemlist
The addItems handler appends a list of items in itemList to the items in the
MultiLinePicker.

Page 455
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a d d i t e m s o f M u l t i L i n e P i c k e r

me (a MultiLinePicker)
itemlist

MultiObjectStateCheckbox
(a CheckBox)

A child of CheckBox that controls a boolean property in multiple objects. This checkbox has three states.
When it is checked , the property is set to True in all the objects the checkbox controls. When it is
unchecked, the property is set to False in all the objects controlled. The third "gray" state restores the
original values of that property for all the objects controlled. The original state is saved when the objects
are associated to the checkbox.
The stateProperty property tells the checkbox which boolean property of its objects it is controling.
The objects affected are stored in the objects property.

Example
Consider a rectangle called "Julio" that has two other rectangles in it called "Pipo" and "Cacho". Now we
create a new MultiObjectStateCheckbox and add it to Julio's contents . From there we let it control
whether Pipo and Cacho are visible.
Pipo and Cacho. One is visible, one is not.
set the visible of Pipo to false
Create the checkbox and make it control Pipo's and Cacho's visible property.
new MultiObjectStateCheckBox with objectName "coolCheckBox"
set the container of coolCheckBox to Julio
set the stateProperty of coolCheckBox to 'visible'
set the objects of coolCheckBox to {Pipo, Cacho}
Notice that the coolCheckBox became gray since the objects differed in the value of the stateproperty.

See Also
objects , stateProperty and the CheckBox object.

Page 456
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c h e c k e d o f M u l t i O b j e c t S t a t e C h e c k b o x

Properties of MultiObjectStateCheckbox

checked of MultiObjectStateCheckbox
Specifies the state of the checkbox. The MultiObjectStateCheckbox has three states: True
meaning that the stateProperty is true in all the objects , False meaning that the
state property is false for all the objects and 'mixed' meaning that it is true for some (but
not all) the objects.

Setter
set the checked of me
with update
to NewValue

Changes the state of the checkbox and (if the update argument is True ) sets the
stateProperty of all of the checkbox's objects to the appropriate value according to the
state:

state is True : the stateProperty is set to True in all the objects.

state is False : the stateProperty is set to False in all the objects.

state is 'mixed': the stateProperty is set to the original values in all the objects.

The original values are the values the stateProperty had in all the objects when the
objects property of the checkbox was set.

me (a MultiObjectStateCheckbox)
[with update] (a boolean): If True (the default), the properties in the
controlled objects get updated when the checkbox changes state.
to: The new state. Can be True , False or 'mixed' .

See Also

objects and stateProperty.

objects of MultiObjectStateCheckbox
A collection of objects. They all have a boolean property whose value is controlled by this
checkbox. The property in question is stored in the stateProperty property of this
object.

Page 457
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s t a t e P r o p e r t y o f M u l t i O b j e c t S t a t e C h e c k b o x

Getter
get the objects of me

me (a MultiObjectStateCheckbox)

Setter
set the objects of me
to NewValue

Associates the checkbox to all the objects in the objects argument. We save the value of
the stateProperty for each object. The checkbox then checks itself to reflect the states of the
objects it controls: if the property is True for all of them, the checkbox is checked. If the
property is False for all of them, the checkbox is unchecked. Finally, if the property is
True for some and False for others, the checkbox appears gray (this is the 'mixed' state).

me (a MultiObjectStateCheckbox)
to: A list of objects.

See Also

stateProperty.

stateProperty of MultiObjectStateCheckbox
Specifies the property that this checkbox will control in all its objects .

Getter
get the stateProperty of me

me (a MultiObjectStateCheckbox)

Setter
set the stateproperty of me
to NewValue

me (a MultiObjectStateCheckbox)
to (a Symbol): The property to be controlled.

See Also

MultiObjectStateCheckbox for an example of using this property.

Page 458
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c h e c k o f M u l t i O b j e c t S t a t e C h e c k b o x

Handlers of MultiObjectStateCheckbox

check of MultiObjectStateCheckbox
check me
Advances to the next state of the multiObjectStateCheckbox.
If the checked property equals 'mixed' , it sets it to True (Mixed to on). If checked
equals True , it sets checked to False (On to off). Otherwise (checked equals False ) it
sets checked to 'mixed' (Off to mixed).

me (a MultiObjectStateCheckbox)

See Also

checked .

MultiRenderer
(a Renderer)

Calls render on each item in its rendererList property. All these renderers get called to render the
same region.

Properties of MultiRenderer

rendererlist of MultiRenderer
A list of the renderers the MultiRenderer uses to render itself. Each item of the list
will get the render message when the MultiRenderer gets it.

Getter
get the rendererList of me

Page 459
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e n d e r o f M u l t i R e n d e r e r

me (a MultiRenderer)

Setter
set the rendererlist of me
to NewValue

me (a MultiRenderer)
to: A list of renderers.

Handlers of MultiRenderer

render of MultiRenderer
render me, theactor, region, thepaper
Paints the region provided. Calls render on each of the items in its rendererList
property. The region given is passed to them.

me (a MultiRenderer)
theactor (an Actor): The Actor currently being drawn.
region (a Mask): The region to be painted.
thePaper: The surface on which the drawing takes place. This argument
should be passed "as is" to other render handlers and some handlers
defined on the Pen and Mask objects.

See Also

rendererList .

Translucent of MultiRenderer
Translucent me
Returns True if every renderer in the multirenderer's rendererList is translucent.

me (a MultiRenderer)

See Also

rendererList .

Page 460
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d o b o o k k e e p i n g o f N a m e F i e l d

NameField
(a QueryField)

The namefield is a QueryField with two modifications. First the text of the textfield is changed
upon evaluation to the text of the result of the query. Second the historyMenu records the results of the
queries rather than the queries themselves. Note that the historyMenu is a pickerMenu .

Handlers of NameField

dobookkeeping of NameField
doBookKeeping me
with warnings
with history
Call the inherited handler, then add the new item to my historymenu .

me (a NameField)
[with warnings]
[with history]

NonNegativeInteger
(a VirtualType)

This is a VirtualType that is satisfied by any integer greater than or equal to zero.

See Also
PositiveInteger, VirtualType

Page 461
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t y p e S a t i s fi e d o f N o n N e g a t i v e I n t e g e r

Handlers of NonNegativeInteger

typeSatisfied of NonNegativeInteger
typesatisfied me, obj
Returns true if the given object is an integer greater than or equal to zero.

me (a NonNegativeInteger)
object

NoResponse
(a ConditionResponse)

Invoking this response simply returns without performing any action (i.e. acts as if the condition had not
occurred — execution simply continues from the point where the condition was raised).
This response is always invokable.
Note: Though it is always invokable, this response should be used with great care, as ignoring an error
may lead to scripts being executed in an improper and potentially dangerous context.◆

See Also
ConditionResponse , the Condition System section of the User Guide's SK8Script Language chapter

Handlers of NoResponse

invoke of NoResponse
invoke me
This handler simply returns without performing any action (i.e. invoking this response
acts as if the condition had not occurred — execution simply continues from the point
where the condition was raised).

me (a NoResponse)

Page 462
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w r i t e O b j e c t o f N o R e s p o n s e

See Also

ConditionResponse

writeObject of NoResponse
writeObject me, thestream, rereadably
If rereadably is True , this just does the inherited writeObject behavior. Otherwise it
writes a description of what the NoResponse response will do when invoked.

me (a NoResponse)
theStream
rereadably

See Also

ConditionResponse , writeObject of Object

NotAHandlerError
(a ProgrammaticError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

Properties of NotAHandlerError

Object of NotAHandlerError

Getter
get the Object of me

Setter
set the object of me
to NewValue

Page 463
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c u r r e n t Va l u e o f N u m b e r P r o p e r t y E d i t o r

Number
(an Object)

This object is the ancestor of all numbers. Numbers are further categorized by Real and Complex .

See Also
Real , Complex

NumberMemoryFullError
(a MemoryFullError)

See Also
The Condition System section of the User Guide's SK8Script Language chapter

NumberPropertyEditor
(a SimplePropertyEditor)

This is a tiny editor for getting a number from a user to specify the value of some property. There is an
objects property and a propertyname property to specify what it is editing. The user can type a
value into the textfield and this value is put into the property when either the user types return or
enter or when the text is deactivated.

See Also
currentValue

Handlers of NumberPropertyEditor

currentValue of NumberPropertyEditor
currentValue me

Page 464
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c u r r e n t Va l u e o f N u m b e r P r o p e r t y E d i t o r

This returns the value in the text field or False if it is not a number.

me (a NumberPropertyEditor)

Object

All SK8 objects descend from Object . Object contains all the handlers needed to create new objects or
copies of objects, initialize objects, add or remove properties, add or remove parents, assign object names,
and more. If you create an object and you don't care who its parent should be, you should probably use
Object as the parent.

Note: Overriding the behavior of Object can have deep repercussions throughout the system. SK8 is
happy to let you do that. To change the behavior of any handler of Object (or of any SK8 object), your
should create a new child of the SK8 object into your project and shadow the SK8 handler for it.◆

Example
The following statement creates an anonymous object and binds it to the variable x . One would not again
be able to access this object unless it were bound to a variable (or to an object's property).
set x to a new object
If the object were not bound to x , then there would be no way for you to access the object. In that case,
the object would be automatically trashed by the system. The SK8 garbage collector is responsible for
ensuring that storage allocated for objects is regularly trashed: you need not take any explicit action to do
so.
The following is an example of creating a named object. The named object is automatically bound to the
global constant MyNamedObject . How does this differ from creating an anonymous object (as in the first
example) and then binding it to the variable MyNamedObject ? Only in that when one creates a named
object, MyNamedObject is a constant instead of a variable. This means that you cannot accidentally
re-bind MyNamedObject to anything else, unless you unname or rename the object via the objectName
property.
new object with objectName "MyNamedObject"
An object always exists in one and only one project. To refer to a named object in a within a project, one
need only specify the name of the object:
get MyNamedObject's fillColor
If one wants to refer to a named object in another project, one must explicitly specify the project name.
For example, to explicitly refer to the object MyNamedObject which resides in the project MyWidgets ,
one uses the following expression:
get the fillColor of MyNamedObject (in project MyWidgets)

Page 465
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d o n t S a v e o f O b j e c t

However, this is not very modular because you may accidentally access an object in a project that may
not later exist. SK8 facilitates modular access to information between projects such that, in this case, if
MyNamedObject were to have been created in a superproject of the project in which it exists, it would be
directly accessible to its subproject(s).
Objects are created in the project in which the object creation code was compiled. To explicitly specify the
project in which an object should be created, use the project keyword argument. For example, to create
MyNamedObject in project MyProject :
new object with objectName "MyNamedObject" with project MyProject

See Also
knownChildren , parents , baseParent , objectName .

Properties of Object

dontSave of Object
If an object is never to be saved in a project or preserved to a standalone application, it
should provide this handler returning True dontSave of Object returns False .
All references to an object whose dontsave handler returns True are saved as False .

Getter
get the dontSave of me

me (an Object)

inheritedPropertiesToSaveAsFalse of Object
Returns a list of some of the inherited real properties of this object. The results of this
virtual property contribute to the value of the virtual property
propertiesToSaveAsFalse .

Getter
get the inheritedPropertiesToSaveAsFalse of me

me (an Object)

See Also

propertiesToSaveAsFalse

Page 466
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n h e r i t e d P r o p e r t i e s To S a v e S p e c i a l l y o f
O b j e c t

inheritedPropertiesToSaveSpecially of Object
Returns a list of some of the inherited real properties of this object. The results of this
virtual property contribute to the value of the virtual property
propertiesToSaveSpecially.

Getter
get the inheritedPropertiesToSaveSpecially of me

me (an Object)

See Also

propertiesToSaveSpecially

localPropertiesToSaveAsFalse of Object
Returns a list of some of the local real properties of this object. The results of this virtual
property contribute to the value of the virtual property propertiesToSaveAsFalse .

Getter
get the localPropertiesToSaveAsFalse of me

me (an Object)

See Also

propertiesToSaveAsFalse

localPropertiesToSaveSpecially of Object
Returns a list of some of the local real properties of this object. The results of this virtual
property contribute to the value of the virtual property propertiesToSaveSpecially.

Getter
get the localPropertiesToSaveSpecially of me

me (an Object)

See Also

propertiesToSaveSpecially

Page 467
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o b j e c t N a m e o f O b j e c t

objectName of Object
This property specifies the name of an object.
The objectName is a case-sensitive string which will serve as the name of the object. If
you want to unname an already named object, then set its objectName to False .
Naming an object is the most direct and fastest way you can access an object within your
project.
The objectName uniquely identifies the object within a SK8 project. The object's name
becomes accessible to all subprojects so that it is not possible to have two objects with the
same name in projects that require each other. Any SK8 object, except for a collection, can
have an objectName . An object without an object name is called an anonymous or
unnamed object.
Note: You cannot change the name of a Project in SK8 1.0.◆

Getter
get the objectName of me

me (an Object)

Setter
set the objectname of me
with force
to NewValue

me (an Object)
to (a String): The new name for the object. Passing False makes the object
become anonymous.

Example
This example shows how you can create an unnamed object and then name it.:
set x to a new object
set x's objectname to "MyNewObject"

The following statement shows you how you can do the same thing in one line.
new object with objectName "MyNewObject"

See Also

new, copy.

Page 468
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p a r e n t s o f O b j e c t

parents of Object
The parents property returns a list of all parents of the object.
Since SK8 supports multiple inheritance, an object may have more than one parent. The
first (or only) object appearing in the list of parents is also known as its base parent. The
base parent is retrieved it by using the baseParent handler.

Getter
get the parents of me

me (an Object)

Setter
set the parents of me
to NewValue

The setter calls changeParents to do the work.

me (an Object)
parents: Should be a list of parents to replace the current parents of the
object.

See Also

knownChildren , baseParent and changeParents .

private of Object
The private property marks a property or an object as either private or public.
A private property or object is one which should not normally be directly accessed by
subprojects of the project of the object for which the property has been defined. One can
make a property or object private or cease it from being private at any time.
Browsers and other user interface viewers may use the fact that a property or object is
private in order to restrict its appearance in appropiate contexts. An object or property's
"privacy" is enforced only by user interfaces or by other users, but not by SK8. In
particular, it is enforced by the SK8 Project Builder.

Getter
get the private of me
with property

Page 469
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p r o p e r t i e s o f O b j e c t

Private can be used to find out whether an object or an object's property is private or not.
If one does not provide the property argument, then private returns True if the object is
itself private; otherwise it returns False .

me (an [[Object]]): The target object.


[with property] (a [[Symbol]]): This symbol represents the name of a
property.

Setter
set the private of me
with property
to NewValue

One can either make the object or one of its properties private by letting to be True and
public by letting to be False .

me (an [[Object]]): The target object.


[with property] (a [[Symbol]]): This symbol represents the name of a
property.
to (a boolean): True to make the object or property private. False to make
it public.

Example
To find out whether the property fillColor of Actor is private:
get the private of Actor with property 'fillColor'
To find out whether the object Actor is private:
get the private of Actor

See Also

private of Handler, private of Function

properties of Object

Getter
get the properties of me

This returns a list of all of the properties of Object. Each item in the list is a symbol
representing a property name. Same as realProperties.

Page 470
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p r o p e r t i e s To S a v e A s F a l s e o f O b j e c t

me (an Object)

propertiesToSaveAsFalse of Object
Returns a list of some of the real properties of this object. All of these properties will be
saved to the store as False .

Getter
get the propertiesToSaveAsFalse of me

me (an Object)

propertiesToSaveNormally of Object
Returns a list of some or all of the real properties of this object which are not also in
propertiesToSaveSpecially or propertiesToSaveAsFalse . The values of these
properties will be saved to the store as they are.

Getter
get the propertiesToSaveNormally of me

me (an Object)

propertiesToSaveNormallyIncludingInternals of Object
Returns a list of some or all of the real properties of this object which are not also in
propertiesToSaveSpecially or propertiesToSaveAsFalse . The values of these
properties will be saved to the store as they are. Also includes some private properties of
Object that are not normally revealed to users.

Getter
get the propertiesToSaveNormallyIncludingInternals of me

me (an Object)

Page 471
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p r o p e r t i e s To S a v e S p e c i a l l y o f O b j e c t

propertiesToSaveSpecially of Object
Returns a list of some of the real properties of this object. Before saving any of these
properties to the store, SK8 should call saveToStore which will return the actual value
that should be saved.

Getter
get the propertiesToSaveSpecially of me

me (an Object)

See Also

saveToStore

prototype of Object
Participating in the prototype protocol means no more than the fact that an object is
marked as a prototype. Other projects (including the SK8 Project Builder) can rightly
assume that an object marked as a prototype object can be the basis for creating children
or copies of it. Further extensions for participation in this protocol are reserved by SK8.

Getter
get the prototype of me

Returns True when the object is a prototype object; otherwise it returns False .

me (an Object): The object being checked.

Setter
set the prototype of me
to NewValue

Can be set to True to make the object be a prototype conforming to the prototype
protocol, or to False to cease the object's participation in that protocol.

me (an Object): The object whose prototype status you want to change.
to: True or False .

Page 472
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a d d I n p u t O u t p u t P o r t o f O b j e c t

Handlers of Object

addInputOutputPort of Object
addInputOutputPort me, property
with objectname
with triggerbefore
with signature
with prototype
addInputOutputPort allows you to add an input-output port to a property of an object.
You specify the object and property and various optional arguments which allow you to
(1) specify the kind of port it should be, (2) the kinds of ports it can be legally wired to, (3)
whether the port should be triggered before or after the property value is set, and (4)
assign a name to the port.

me (an Object)
property
[with objectname]
[with triggerbefore]
[with signature]
[with prototype]

See Also

removePort

addInputPort of Object
addInputPort me, property
with objectname
with signature
with prototype
The addInputPort handler creates a new Port and assigns it to the specified property of
the specified object. The Port's name is specified in the optional portName argument.
Creates a new InputPort and attaches it to the specified property of the specified Object.

me (an Object)
property
[with objectname]
[with signature]
[with prototype]

Page 473
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a d d O u t p u t P o r t o f O b j e c t

Example
addInputPort object, property
with
portName name - default: same name as property
valueTypes name - default: true

See Also

addInputOutputPort , addOutputPort , attachPort , detachPort

addOutputPort of Object
addOutputPort me, property
with objectname
with triggerbefore
with signature
with broadcasting
with prototype
Creates a new InputOuputPort and attaches it to the specified property of the specified
Object.

me (an Object)
property
[with objectname]
[with triggerbefore]
[with signature]
[with broadcasting]
[with prototype]

Example
addOutputPort object, property
with
portName name - default: same name as property
valueTypes name - default: true
when [before or after]

See Also

addInputPort , addInputOutputPort , attachPort , detachPort

Page 474
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a d d P r o p e r t y o f O b j e c t

addProperty of Object
addProperty me, name
with private
with propagatedvalue
with initialvalue
You use addProperty to add a property to an object at any time. Adding a property to an
object will create this property for all of its existing and future descendants. A property
directly added to an object using addProperty makes that property a local property of the
object and an inherited property for all of its descendants.
Note: You can also add properties using the Project Builder's Object Editor.◆

me (an Object)
name
[with private]
[with propagatedvalue]
[with initialvalue]

Example
In the following example, we create an object named "Person" and add a property called
"firstName". The first name is initialized to "Unknown".
new Object with objectName "Person"
addProperty Person,'firstName' with initialValue "Unknown"

See Also

removeProperty

ancestors of Object
ancestors me
ancestors returns a list with all of the ancestors of an object. The ancestors include the
direct parents of the object, the parents' parents, and so on.
Note: If you are getting the ancestors of an object to perform an operation to each of them
at a time, then this is not an efficient way of doing it. Use mapAncestors instead.◆

me (an Object)

See Also

mapAncestors , descendants

Page 475
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a s Ty p e o f O b j e c t

asType of Object
asType me, obj
with project
The "generic" entry point; dispatches on the given type.
The default handler dispatches one of the more specific object-dispatched coercers
(objectAsNumber, objectAsString, objectAsList) or the general object-dispatched coercer
(objectAs)
The default is to re-dispatch to objectAs .

me (an Object): The type to which the given object is to be coerced.


obj: The object to be coerced to the given type.
[with project] (a Project): The project in which new object (resulting from the
coercion) is to be created. The default is the project of the script in
which the coercion is being done

See Also

astype , objectAsNumber, objectAsString , objectAsList , objectAs , numberAs ,


stringAs , collectionAs

autoWire of Object
autoWire me, otherobject
Makes all possible wire connections from all OutputPorts of me to all possible InputPorts
of ObjectToWhichToWire and also between all InputOutputPorts of the two objects. The
signatures of the ports are important in that they determine which connections are legal.

me (an Object)
otherobject

Example
autowire fromObject, toObject

See Also

signature , portsCompatible

collectionLike of Object
collectionLike me

me (an Object)

Page 476
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o p y o f O b j e c t

copy of Object
copy me, props

me (an Object)
[[props]*]

earlyInitializeFromStore of Object
earlyInitializeFromStore me
This is called after memory has been allocated for the object. At this stage of loading a
project, values of properties may refer to objects that have not yet been loaded.

me (an Object)

equalTo of Object
equalTo me, other
with exactmatch
The default handler returns true if me is the same object as other.

me (an Object)
other

findPort of Object
findport me, property, portType
with resultensured
This handler returns the port that is connected to the object. To find the port we need to
specify the object, the property on which the port is defined and the type of port.

me (a Object): The object whose port we are looking for.


property (a Symbol): The property to which the port we are interested in
would connect.
portType: The type of port we want. One on 'input' , 'output' or
'inputOutput' .
[with resultensured]: If True , if the port in question is not found, a port of
the appropriate type is created and hooked up to the property specified.
If False and the port is not found we just return False .

Page 477
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
g e t D u p l i c a t e F r o m U s e r o f O b j e c t

Example
To get the port that outputs the currentValue of a Scroller to its partner picker or editText,
we would type the following line:
findPort myScroller, 'currentValue', 'output'

See Also

ports .

getDuplicateFromUser of Object
getDuplicateFromUser me
with project
with locked
getDuplicateFromUser brings up a dialog box that lets the user create a duplicate of
an existing object.

me (an Object)
[with project]
[with locked]

See Also

getFromUser, getNewFromUser

getFromUser of Object
getFromUser me
with multiplevalues
with project
with popupmenu
with relativeactor
Use getFromUser to obtain a suitable object from a user. getFromUser is defined for
each kind of object in SK8. You can provide your own version of getFromUser or use the
inherited one.

me (an Object)
[with multiplevalues]
[with project]
[with popupmenu]
[with relativeactor]

Page 478
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
g e t N e w F r o m U s e r o f O b j e c t

See Also

getNewFromUser, getDuplicateFromUser

getNewFromUser of Object
getNewFromUser me
with project
with locked
Use getNewFromUser to obtain a suitable new child of the given object from a user. You
can implement your own version of getNewFromUser for your objects.

me (an Object)
[with project]
[with locked]

See Also

getFromUser, getDuplicateFromUser

handlers of Object
handlers me
with name
with inherited
with local
Use handlers to get a list of handler objects for any given object. The handler objects
represent the handlers that have been defined on or which have been inherited by an
object.

me (an Object)
[with type]
[with name]
[with inherited]
[with local]

Example
To get the names of all handlers for an object called MyObject, use the following SK8Script
statement:
get the name of every item in the handlers of MyObject

Page 479
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n h e r i t e d H a n d l e r s o f O b j e c t

See Also

localHandlers , inheritedHandlers , the Handler object

inheritedHandlers of Object
inheritedHandlers me
Returns all of the handlers inherited by the object from its ancestors. This is a list of
handler objects.

me (an Object): An Object.

See Also

handlers , localHandlers , the Handler object

inheritedRealProperties of Object
inheritedRealProperties me
Returns a list containing all of the properties of an object which are inherited and which
have space allocated for them in the object. This list is represented as a list of symbols,
each representing a property name. If there are no inherited real properties, this handler
returns False .

me (an Object)

See Also

inheritedVirtualProperties , realProperties

inheritedVirtualProperties of Object
inheritedVirtualProperties me
Returns a list of all inherited virtual properties of an object. This is a list of symbols. Each
symbol represents the name of a property. Virtual properties are handlers that can be
treated as if they were properties but which have no real space allocated in the object. A
virtual property has a setter and a getter.
Note: Only virtual properties defined in the SK8 project are supported. You cannot create
your own virtual properties in SK8 1.0.◆

me (an Object)

Page 480
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n i t i a l i z e o f O b j e c t

See Also

localVirtualProperties , virtualProperties

initialize of Object
initialize me, original, isnew, initargs
The initialize handler allows you to do something to your object right after it is created
either by the new or copy handler. You should always call the inherited initialize handler
within your initialize before you do you own special initialization. You should use
initialize rather than new or copy to define special initialization behavior for your objects.
The initialize handler for Object does nothing. new and copy call initialize on the child or
copy that they create after memory has been allocated for it and its properties have been
initialized.
Note: The internal structure of the initarg object passed to initialize might change in
future versions of SK8. Use the functions initializerArgument to extract information
from the initargs object.◆

me (an Object): An Object.


original: The original object on which new or copy was invoked to create a
child or copy.
child: This is either True or False . If the object is created via new, then this
is True . If the object is created via copy, then this is False .
initargs: This is an object which contains information about all the keyword
arguments (and their corresponding values) that have been passed to
new or copy when this object was created. You should use the function
initializerArgument to obtain from this object the value for any
argument that you are interested (including a list of all arguments that
have been passed in).

Example
One of the many uses of initialize is to create a complex new object. For example, the
TextField object is composed of a Scroller and an EditText component. Whenever a new
TextField is created, its initialize handler ensures that a copy of each component is created.
Suppose you want to create an object called Beeper which beeps whenever a child of that
object is created. initialize will beep as many times as the number in that child's property
'beepCount'. The example shows you one way of doing this. (Note the use of the
initializerArgument function.)

Page 481
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n i t i a l i z e F r o m S t o r e o f O b j e c t

on initialize of me (a Beeper), original, child, initargs


do inherited
-- find out whether beepCount was passed in
-- and, if so, what the value of beepCount is
set count to initializerArgument (initargs, 'beepCount')
if count then beep count
end initialize

See Also

new, copy, initializeFromStore , addedMeAsParent , initializerArgument ,


processUnusedInitializerArguments

initializeFromStore of Object
initializeFromStore me
InitializeFromStore is called by object loader on an object immediately after it has been
loaded from the store. You can use initializeFromStore to perform any special load-time
intialization for your objects. InitializeFromStore is responsible for performing all
initialization required for the object to be functional insofar as your own objects require
this.
The inverse function saveToStore lets you save the state of your object before it is saved by
the object store.
You must always call the inherited handler before performing your own initialization. If
it returns False , then you should return False without any further processing.

me (an Object)

Example
Suppose that you have an object (say, called NeatServerClient) that maintains a
connection to some server in the network and that your object maintains some
platform-specific information about the connection. You could use initializeFromStore to
restore this information based on the state at load-time. Alternatively, you may want to do
this at the time the opened event is sent to your project. The first approach allows you to
keep the restoration of your object associated with the object itself.
on initializeFromStore of me (a NeatServerClient)
do inherited
setUpConnection me
return true
end initializeFromStore
The second approach requires that the project object know about this other object, as you
can here see:

Page 482
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n p u t O u t p u t P o r t s o f O b j e c t

on opened of me (a DistributedAppProject)
do inherited
setUpConnection NeatServerClient
end opened

See Also

propertiesToSaveAsFalse of Object , propertiesToSaveSpecially of


Object , saveToStore of Object , opened of Project

inputOutputPorts of Object
inputOutputPorts me
Returns a list of the InputOutputPorts currently attached to this Object.

me (an Object)

Example
get the inputOutputPorts of Object

See Also

inputPorts , outputPorts , ports

inputPorts of Object
inputPorts me
Returns a list of the InputPorts currently attached to the specified object.

me (an Object)

Example
get the inputPorts of Object

See Also

inputOutputPorts , outputPorts , ports

knownChildren of Object
knownChildren me

Page 483
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
k n o w n D e s c e n d a n t s o f O b j e c t

The knownChildren property lists all the known children of an object. If the object has
no known children, then False is returned. A child is created by using the new handler
on an object.
All named objects are automatically added to the knownChildren list of its parents by
SK8 when they are created via the new or copy handlers. In addition, you can add
anonymous objects to the knownChildren list yourself using the initialize and
addedMeAsParent handlers, if you want them to be known.

Note: knownChildren does not include all children of an object. Anonymous objects are
not automatically added to the knownChildren list by SK8.◆

me (an Object)

See Also

parents , baseParent .

knownDescendants of Object
knownDescendants me, proj
Returns a list that includes all the descendants of the object in question. The descendants
are the children of the object, their children, their children's children and so on.
Note: getting the knownDescendants of something up in the object hierarchy is not a
good idea since it takes a lot of space and time to put together the list. If you want to do
something to every object in the system, use mapKnownDescendants instead.◆

me (an Object)

See Also

The function mapKnownDescendants .

localHandlers of Object
localHandlers me
Returns a list containing all the local handlers of the object. Each item in the list is a
Handler object (that is, a child of Handler). False is returned if the object does not have
any local handlers.

me (an Object): An Object.

See Also

inheritedHandlers , the Handler object

Page 484
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l o c a l P r o p e r t i e s o f O b j e c t

localProperties of Object
localProperties me
Returns a list of all of the local properties of an object, which includes both real and virtual
properties. This is a list of symbols. Each symbol represents a property name. A local
property is one that was directly added to an object using addProperty or which is
defined as a virtual property of the object.

me (an Object)

See Also

properties , inheritedProperties

localProperties for mods of Object


localproperties for mods me

me (an Object)

See Also

properties for mods

localRealProperties of Object
localRealProperties me
localRealProperties returns a list of all of the local real properties of an object. The list
consists of symbols, each of which represents the name of a property.

me (an Object)

See Also

localProperties , virtualProperties , inheritedProperties

localVirtualProperties of Object
localVirtualProperties me
Returns a list of all of the local virtual properties of an object. This is a list of symbols.
Each symbol represents a property name. Virtual properties are handlers that can be
treated as if they were properties but which have no real space allocated in the object. A
virtual property has a setter and a getter.

Page 485
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a k e O b j e c t A P r o x y o f O b j e c t

Note: Only virtual properties defined in the SK8 project are supported. You cannot create
your own virtual properties in SK8 1.0.◆

me (an Object)

See Also

virtualProperties , inheritedVirtualProperties

makeObjectAProxy of Object
makeObjectAProxy me, objectproxied
makeObjectAProxy allows you to make any object into a proxy for another object.

me (an Object)
objectproxied

See Also

the Proxy object

makeProxyFor of Object
makeProxyFor me
with objectname
makeProxyFor makes a new proxy for the object. Each call to makeProxyFor creates a new
proxy. Proxies are objects which behave exactly like the object for which they are a proxy,
but can be used to intercept handler calls to those objects by implementing special
handlers to the proxies.

me (an Object)
[with objectname]

See Also

the Proxy object

mapAncestors of Object
mapAncestors me
with function
mapAncestors will apply the provided function to each ancestor of an object, starting with
the parents first, then their parents, and so on.

Page 486
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
n a m e o f O b j e c t

Note: This is more efficient that getting the known ancestors via the knownAncestors
handler since mapKnownAncestors does not allocate memory for the list of returned
ancestors and since, for many ancestors, the function can be applied sooner rather than
after all of the ancestors have been found.◆

me (an Object)
[with function]

See Also

mapKnownDescendants

name of Object
name me
The name of an object is, by default, its objectName . If you want to change the way that
the named construct works in SK8Script to use something other than the objectName ,
you can override the name handler for your objects to return the appropiate name.
Note: Changing what an object's name handler returns does not affect the object's
objectName .◆

me (an Object)

See Also

objectName

new of Object
new me, initargs

me (an Object)
[[props]*]

numberAs of Object
numberAs me, obj
with project
This handler, part of the coercion protocol, is called by the 'as a' operator when
the given destination type is
by the default asType handler
the given destination type is Number or any of the knownDescendants of Number.

Page 487
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o b j e c t A s o f O b j e c t

It enables user-defined objects to support coercion into numbers. It should either perform
the coercion and return the resulting number or, if unable to do the coercion, do
inherited and return what that returns.

The default handler simply raises a CoercionError if me is not a number.

me (an Object): The type to which the given number is to be coerced.


obj: The number to be coerced to the given type.
[with project] (a Project): The project in which new object (resulting from the
coercion) is to be created. The default is the project of the script in
which the coercion is being done

See Also

$$coercionXrefs$

objectAs of Object
objectAs me, type
with project
The secondary entry point, called by asType's default handler; dispatches on the given
object.
The default handler dispatches one of the more specific type-dispatched coercers
(numberAs, stringAs, collectionAs) or raises a CoercionError to indicate its failure

me (an Object): The object to be coerced to the given type.


type: The type to which the given object is to be coerced.
[with project] (a Project): The project in which new object (resulting from the
coercion) is to be created. The default is the project of the script in
which the coercion is being done

See Also

astype , objectAsNumber, objectAsString , objectAsList , objectAs , numberAs ,


stringAs , collectionAs

objectAsList of Object
objectAsList me
with project
This handler, part of the coercion protocol, is called by the 'as a' operator when the given
destination type is List (and, in some cases, as an intermediate step when the given
destination is another type of collection, e.g. Vector ).

Page 488
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o b j e c t A s N u m b e r o f O b j e c t

It enables user-defined objects to support coercion into lists. It should either perform the
coercion and return the resulting list or, if unable to do the coercion, do inherited and
return what that returns.
The default handler simply raises a CoercionError if me is not a list.

me (an Object): The object to be coerced to a list.


[with project] (a Project): The project in which new object (resulting from the
coercion) is to be created. The default is the project of the script in
which the coercion is being done

See Also

astype , objectAsNumber, objectAsString , objectAsList , objectAs , numberAs ,


stringAs , collectionAs

objectAsNumber of Object
objectAsNumber me
with type
with project
This handler, part of the coercion protocol, is called by the 'as a' operator when the given
destination type is Number or any of the knownDescendants of Number.
It enables user-defined objects to support coercion into numbers. It should either perform
the coercion and return the resulting number or, if unable to do the coercion, do
inherited and return what that returns.

The default handler simply raises a CoercionError if me is not a number.

me (an Object): The object to be coerced to a number.


[with type]: Specifies the type of number to which the given object is to be
coerced (i.e. one of the knownDescendants of Number ); if False , the
default, objectAsNumber may produce any type of number.
[with project] (a Project): The project in which new object (resulting from the
coercion) is to be created. The default is the project of the script in
which the coercion is being done

See Also

astype , objectAsNumber, objectAsString , objectAsList , objectAs , numberAs ,


stringAs , collectionAs

objectAsString of Object
objectAsString me
with project

Page 489
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o u t p u t P o r t s o f O b j e c t

This handler, part of the coercion protocol, is called by the 'as a' operator when the given
destination type is String .
It enables user-defined objects to support coercion into strings. It should either perform
the coercion and return the resulting string or, if unable to do the coercion, do
inherited and return what that returns.

The default handler simply raises a CoercionError if me is not a string.

me (an Object): The object to be coerced to a string.


[with project] (a Project): The project in which new object (resulting from the
coercion) is to be created. The default is the project of the script in
which the coercion is being done

See Also

astype , objectAsNumber, objectAsString , objectAsList , objectAs , numberAs ,


stringAs , collectionAs

outputPorts of Object
outputPorts me
Returns a list of the OutputPorts currently attached to this Object.

me (an Object)

See Also

inputPorts , inputOutputPorts , ports

ports of Object
ports me
Returns a list of all ports (all types; InputPorts, OutputPorts and InputOutputPorts) that
are attached to the specified object.

me (an Object)

See Also

inputPorts , inputOutputPorts , outputPorts

preserve of Object
preserve me

Page 490
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p r o p e r t i e s f o r m o d s o f O b j e c t

The preserve handler is called by SK8 whenever you create a double-clickable SK8
application. If you use this feature of SK8, then you should define a preserve handler for
all objects in your system whose state must be preserved in a special way. This is
particularly useful if you maintain any low-level, platform-dependent state, such as you
might do if you keep state outside the SK8 system via foreign-function access or
interprocess communications. You use the restore handler to restore this state when your
application loads after it is started by a user.
You should call the inherited preserve handler before doing your own preservation.
You should only use preserve if you create a double-clickable SK8 application. Only in
rare circumstances will you want to use preserve yourself.
Note: You should not use the preserve handler unless you understand the details of how
SK8 creates and loads double-clickable applications.◆

me (an Object)

Example
The following preserve handler clears out whatever value is in the property
'timeSessionStarted' of the hypothetical object SessionLog .
on preserve of me (a SessionLog)
do inherited
set my timeSessionStarted to false
end preserve

See Also

restore , buildStandalone

properties for mods of Object


properties for mods me

me (an Object)

See Also

localProperties for mods

property of Object
property me, name
Returns True if the real or virtual property belongs to the object. Otherwise, it returns
False .

Page 491
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e a l P r o p e r t i e s o f O b j e c t

me (an Object)
name

Example
The following statement should always beep:
if property(Object,'knownChildren') = ('knownChildren' is contained
by the properties of Object) then beep

See Also

realProperties , virtualProperties

realProperties of Object
realProperties me
realProperties returns a list of all inherited and local real properties of an object. This list
consists of symbols, each symbol representing a property name.
A real property is a property for which space is actually allocated in an object (called
"instance variables" in other object-oriented systems).

me (an Object)

See Also

virtualProperties , inheritedRealProperties , localRealProperties

references of Object
references me
with constants
with globals
with properties
with deepsearch
with projects
This handler returns all references to an object in the projects as a list of three items:
1. A list of variables. Each entry in this list is of the form: symbol where symbol is the
name of a variable that refers to this object.
2.A list of constants. Each entry in this list is of the form: symbol where symbol is the
name of a constant that refers to this object.
3. A list of properties. Each entry in this list is of the form: {symbol object} where
object is an object in which a reference is made and symbol is the name of the property
where the reference occurs.

Page 492
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e m o v e H a n d l e r o f O b j e c t

me (an [[Object]]): The object for which you wish to check references.
[with globals] (a Boolean defaulting to True): Specifies whether or not to
include global variables in the search for references.
[with constants] (a Boolean defaulting to True): Specifies whether or not to
include constants in the search for references.
[with properties] (a Boolean defaulting to True): Specifies whether or not to
include the properties of the objects of the project in the search for
references.
[with deepSearch] (a Boolean defaulting to True): Specifies whether or not to
check deeply in lists to see if an object is referenced. If this is false, only
items which refer directly (i.e. their value is me) are returned.
[with projects] (a [[List]]): A list of one or more projects in which the search
should be made. Each item in the list must be a child of Project .
Defaults to my project .

removeHandler of Object
removeHandler me
with name
Use this to remove a local handler from an object. The handler must be directly defined on
the object. To remove an inherited handler, use removeHandler on the ancestor from
which the handler is inherited.
Note: If you want to remove a handler object (i.e., a descendant of Handler) from the
object to which it belongs, you do so directly by calling removeHandler on the hanlder
object, too.◆

me (an Object): The object on which the handler is defined.


[with name] (a String or Symbol): The name of the handler you wish to
remove. A setter for property xyz is identified by the string "set xyz". A
getter for property xyz is identified by the string "xyz" or the symbol
'xyz'.

See Also

removeHandler of Handler

removePorts of Object
removePorts me
with property
with type
removePorts is used to remove existing ports from an object or from an individual
property of an object.

Page 493
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e m o v e P r o p e r t y o f O b j e c t

me (an Object)
[with property]
[with type]

removeProperty of Object
removeProperty me, name
Use removeProperty to remove a property from an object at any time. Removing a local
property from an object will remove that property for all of its existing descendants.

me (an Object)
name

Example
removeProperty Person,'firstName'

See Also

addProperty

restore of Object
restore me
The restore handler is called by SK8 whenever a double-clickable SK8 application loads. If
you use this feature of SK8, then you should define a preserve and restore handler for all
objects in your system whose state must be preserved in a special way. This is particularly
useful if you maintain any low-level, platform-dependent state, such as you might do if
you keep state outside the SK8 system via foreign-function access or interprocess
communications. You use the preserve handler to preserve this state when your
application is created.
You should call the inherited restore handler before doing your own restoration.
You should only use restore if you create a double-clickable SK8 application. Only in rare
circumstances will you want to use restore yourself.
Note: You should not use the restore handler unless you understand the details of how
SK8 creates and loads double-clickable applications.◆

me (an Object)

Page 494
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s a v e To S t o r e o f O b j e c t

Example
The following restore handler restores the state of the property 'timeSessionStarted' of the
hypothetical object SessionLog.
on restore of me (a SessionLog)
do inherited
set my timeSessionStarted to Now()
end restore

See Also

preserve , buildStandalone

saveToStore of Object
saveToStore me, property
Each time saveToStore is called for a property, it returns the value to be saved for the
property (probably a different value than what's stored in the property).

me (a object)
property

See Also

propertiesToSaveSpecially

specialized of Object
specialized me
Returns True when the object has received any handlers or properties of its own, else it
returns False . This is the fastest and most convenient way to find out whether an object
has any local handlers or properties.

me (an [[Object]]): You want to check whether this object is specialized or not.

See Also

localHandlers , localProperties , localProperty

stringAs of Object
stringAs me, obj
with project

Page 495
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t a g P a r t o f O b j e c t

me (an Object)
obj
[with project]

tagPart of Object
tagPart me, partobject, partname
The tagPart handler assigns a tag name of your choice to a complex actor's subActor. A
subActor is a component that is used to create a complex actor. For example, a thumb is a
subActor that is used to create a Scroller, and a cell is a subActor that is used to create a
Viewer.
Once tagged, the tagged object can then be referenced through its tag name and the
complex actor, such as:
set the height of the thumb of the Scroller218 to 12
In addition, any children made from complex actors with tags will inherit updated tags
that reference their subActor components.

me (an Object)
partobject
partname

Example
tagPart complexActor, partObject, partName
tagPart Scroller218, rectangle266, “thumb”

See Also

untagPart , the TagMixin object

virtualProperties of Object
virtualProperties me
Returns a list of all virtual properties of an object. This includes the local and inherited
virtual properties. Virtual properties are handlers that can be treated as if they were
properties but which have no real space allocated in the object. A virtual property has a
setter and a getter.
Note: Only virtual properties defined in the SK8 project are supported. You cannot create
your own virtual properties in SK8 1.0.◆

me (an Object)

Page 496
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w r i t e L o g O b j e c t o f O b j e c t

See Also

localVirtualProperties , inheritedVirtualProperties

writeLogObject of Object
writeLogObject me, strm

me (an Object)
theStream (a TextStream)

writeObject of Object
writeObject me, thestream, rereadably

me (an Object)
theStream (a TextStream)
rereadably (a boolean)

ObjectDataRect
(a Rectangle)

This rectangle along with the PropertyDataRect and the HandlerDataRect are the objects used to
provide drag and drop functionality between the various components. This one is the simplest. It
provides a place to drag a single object or a set of objects from one component to another.

Example
The following is a handler for using the objectDataRect to drag the selecteditem from a picker.
This is a simpler version to what is used by the MixinForObjectPickers .

Page 497
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o m p o n e n t F r o m o f O b j e c t D a t a R e c t

on ExtendedMouseDown of me (a superPicker)
set x to the selecteditems of me
--- If there are selected items
if x then
--- take the first one
set curItem to item 1 in x
--- initialize the object data rect to point to that item
set the objects of the objectDataRect to curItem
set the ComponentFrom of the objectDataRect to me
-- now we find the boundsrect of the item in the picker and set up the
datarect to be over top of it.
set pos to the position(the items of me, curitem)
set the boundsrect of the objectDataRect with physical to the
itemBoundsRect (me, pos) with physical
--- now drag it.
drag objectdatarect with onstage without live
end if
end ExtendedMouseDown

Properties of ObjectDataRect

componentFrom of ObjectDataRect
This is set to the component from which the object is being dragged. This can be used by
components to prevent objects being dropped on themselves.

Getter
get the componentFrom of me

Setter
set the componentfrom of me
to NewValue

Object of ObjectDataRect
This is the property which contains the object or the list of objects which are being
dragged. Note that your code for drops should be able to handle if the property is set to
either a single object or a list.

Getter
get the Object of me

Page 498
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
O b j e c t o f O b j e c t D a t a R e c t

Setter
set the object of me
to NewValue

ObjectList
(a TextList)

This is a TextList whose PickerPrototype has been set to ObjectPicker. Therefore it provides a
nice scrollable version of this browser component. Note that the TextList itself has none of the
browsing functionality, it's Picker does. Thus, whenever you wish to get at the browsing functionality,
you should access the object tagged as the Picker of this object.

Example
set the inputObjects of the Picker of SuperCoolObjectList to {rectangle, oval,
roundrect}

ObjectPicker
(a Picker, MixinForObjectPickers)

This is a picker which has MixinForObjectPickers added as a parent. See


MixinForObjectPickers for more details.

ObjectPile
(a TextList)

This is a TextList whose PickerPrototype has been set to ObjectPilePicker. Therefore it


provides a nice scrollable version of this browser component. Note that the TextList itself has none of
the browsing functionality, it's Picker does. Thus, whenever you wish to get at the browsing
functionality, you should access the object tagged as the Picker of this object.

Example
set the inputObjects of the Picker of SuperCoolObjectPile to {rectangle, oval,
roundrect}

Page 499
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w r i t e O b j e c t o f O b j e c t Ta b l e

ObjectPilePicker
(a Picker, MixinForObjectPiles)

This is a picker which has MixinForObjectPilePickers added as a parent. See


MixinForObjectPilePickers for more details.

ObjectTable
(a Table)

A faster but less generalized form of Table , this uses the same object operator when testing whether
a key is matched.

See Also
Table , TypeTable , same object .

Handlers of ObjectTable

writeObject of ObjectTable
writeObject me, thestream, rereadably
This differs from the inherited writeObject handler in that, if the table's keys are all
Symbol literals, it writes itself just like an AppleScript™ “record”.

me (a ObjectTable)
thestream
rereadably

OSHeapFullError
(a MemoryFullError)

Page 500
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t r i g g e r b e f o r e o f O u t p u t P o r t

OutputPort
(a Port)

When an OutputPort attached to an object is active; it activates the InputPorts that it is wired to.
Note: Set Parent Object: Port◆

Properties of OutputPort

triggerbefore of OutputPort

Getter
get the triggerBefore of me

Setter
set the triggerbefore of me
to NewValue

wiredto of OutputPort

Getter
get the wiredTo of me

Setter
set the wiredto of me
to NewValue

Handlers of OutputPort

activateoutputport of OutputPort
activateOutputport me, oldvalue, newvalue

Page 501
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a t t a c h p o r t o f O u t p u t P o r t

This handler is called on an OutputPort when the property (specified by the by the
OutputPort's portProperty) of the object (specified by the OutputPort's portObject)
changes. The default handler calls activateInputPort on all the InputPorts that this
OutputPort is connected to. You can modify the activateOutputPort handler to process or
modify the value it is passed.

me (an OutputPort)
oldvalue
newvalue

See Also

activateInputPort

attachport of OutputPort
attachPort me
with object
with property
with triggerbefore
Attaches a Port to a specified Object's property. If triggerBefore is True , setting the
property will activate the OutputPort before the property is actually set, otherwise the
OutputPort is activated after the property is actually set.

me (an OutputPort)
[with obj]
[with property]
[with triggerbefore]

See Also

detachPort

portscompatible of OutputPort
portsCompatible me, inport
Checks the signatures of an OutputPort and an InputPort to see if it is permissible to wire
them together. Returns True if they can be wired; False , if not.

me (an OutputPort)
inport

Page 502
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p o r t t y p e o f O u t p u t P o r t

porttype of OutputPort
portType me
Returns the symbol 'input' for an InputPort, 'output' for an OutputPort, 'inputoutput' for
an InputOutputPort, and False for any other type of Port (other types of Ports aren't
currently supported).

me (an OutputPort)

unwireport of OutputPort
unwirePort me
Removes all connections to this Port.

me (an OutputPort)

unwireports of OutputPort
unwirePorts me, toport

me (an OutputPort)
toport

Oval
(an Actor)

Oval is a child of Actor and supports the drawing of circles and ovals with frame regions. An Oval is a
standard rounded shape. The Oval is drawn so that it is constrained by its boundsRect property.

Page 503
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
g e t s h a p e f r o m u s e r o f O v a l

Handlers of Oval

getshapefromuser of Oval
getShapeFromUser me
with starth
with startv
with style
with multipledraw
with shiftconstraint
with boundsrectset
This handler provides a direct manipulation interface to obtain the boundsRect of an
oval . It should be invoked within a mouseDown event, at which point it lets the user drag
the outline of the Oval from the mouseDown point to the current location of the mouse.
When the mouse is released, this handler returns the coordinates of the oval's
boundsRect as a list of 4 values.

If startH and startV are not given, the current location of the mouse is used. This is
good enough in most cases. You may provide different values to override. Your values
will be expected in Stage coordinates.

me (an Oval)
[with starth] (a Number): If provided, specifies the horizontal position of the
start point. Expected in Stage coordinates. If not provided, the location
of the mouse is used.
[with startv] (a Number): If provided, specifies the vertical position of the
start point. Expected in Stage coordinates. If not provided, the location
of the mouse is used.
[with style]: Specifies how the Oval is to be drawn. The default is
'CornerToCorner' , which means that the point specified in the
startH and startV arguments (or the location of the mouse
otherwise) is one of the corners of the Oval's boundsRect . The
opposite corner is the point where the mouse is released. 'CenterOut'
means that the first point is the center of the Oval's boundsRect and
the point where the mouse is released is one of its corners.
[with multipledraw] (a boolean): Specifies whether multiple ovals are
drawn. The default is False .
[with shiftconstraint] (a boolean): If True , pressing the shift key while
moving the mouse lets the user constrain the oval to be created to a
circle. The default is True .
[with boundsrectset] (a boolean): If True , when the mouse is released, the
boundsRect of the oval specified in the me argument is set to the
boundsRect specified. The default is False .

Page 504
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a k e b o u n d s r e g i o n o f O v a l

makeboundsregion of Oval
makeBoundsRegion me
Computes the oval's boundsRegion . This is the largest oval that can be inscribed in the
actor's boundsRect .

me (an Oval)

makefillregion of Oval
makeFillRegion me
Recomputes the fill region of the Oval. The fill region is the boundsRegion minus the
frameRegion .

me (an Oval)

makeframeregion of Oval
makeFrameRegion me
Computes the Oval's frameRegion: the boundsRegion minus the fillRegion .

me (an Oval)

Paragraph
(a TextChunk)

the object that represents a paragraph of text (?)

pen
(an Object)

Represents the graphics pen used for drawing in the system. The Pen object is actually the system's pen
used for all drawing in the system. If you write your own renderer you can set attributes of the Pen and

Page 505
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d o w n o f P e n

use them for drawing. If you use the Pen object for that you should reset it after use (by calling
resetPen ).

Another option is to make a child of Pen and use it to save graphics settings (such as the color and
pensize). Then you can install your pen at the start of your renderer and deinstall it at the end (by
enclosing the body of your handler within a with pen handler).
Note: The Pen should only be used from within the body of a render function since only then is the
right graphic context set up for its use.◆

See Also
with pen , down , size , penMode , ink , textFont , textSize and textStyle and the Mask and its
related functions.

Properties of pen

down of Pen
Specifies whether the pen is down for drawing. When the pen's down is False , graphic
operations using the pen have no effect. The default is True .

Getter
get the down of me

me (a Pen)

Setter
set the down of me
to NewValue

me (a Pen)
to (a boolean)

h of Pen
The horizontal position of the pen. Should always be an integer.

Getter
get the h of me

Page 506
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h e i g h t o f P e n

Setter
set the h of me
to NewValue

me (a Pen)
to (an Integer): The new horizontal location.

See Also

location .

height of Pen
The vertical component of the pen's size .

Getter
get the height of me

me (a Pen)

Setter
set the height of me
to NewValue

me (a Pen)
to (an Integer): The new height of the pen in pixels.

See Also

size .

ink of Pen
Specifies the RGBColor that the pen draws with.

Getter
get the ink of me

me (a Pen)

Page 507
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l o c a t i o n o f P e n

Setter
set the ink of me
to NewValue

me (a Pen)
to (an RGBColor)

location of Pen
Specifies the location of the pen as a list of two numbers.

Getter
get the location of me

me (a Pen)

Setter
set the location of me
to NewValue

me (a Pen)
to: A list of two integers of the form {h,v} .

See Also

h and v.

mode of Pen
The transfer mode used to draw with the pen. The default mode is 'srccopy' . The valid
options are:
'srccopy' , 'srcor' , 'srcxor' , 'srcbic' , 'notsrccopy' , 'notsrcor' ,
'notsrcxor' , 'notsrcbic' , 'patcopy' , 'pator' , 'patxor' , 'patbic' ,
'notpatcopy' , 'notpator' , 'notpatxor' , 'notpatbic' , 'grayishtextor' ,
'Blend' , 'addpin' , 'addover' , 'subpin' , 'addmax' , 'admax' , 'subover' ,
'admin' , 'dithercopy' , 'Transparent' , and 'highlight' .

See Inside Macintosh for descriptions of each one of these.

Getter
get the mode of me

Page 508
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p a t t e r n o f P e n

me (a Pen)

Setter
set the mode of me
to NewValue

me (a Pen)
to: A pen mode. One of the ones specified above.

pattern of Pen
Stores the pattern is any that the pen will draw with. The pattern can be a descendant of
BWPattern of ColorPattern .

Getter
get the pattern of me

me (a Pen)

Setter
set the pattern of me
to NewValue

me (a Pen)
to: A BWPattern or a ColorPattern .

size of Pen
Specifies the size of the pen in pixels. Stored as a list of two integers.

Getter
get the size of me

me (a Pen)

Setter
set the size of me
to NewValue

Page 509
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t e x t f o n t o f P e n

me (a Pen)
to: The new size as a list of two integers of the form {h,v} .

textfont of Pen
Stores the font used to draw text with the pen.

Getter
get the textFont of me

me (a Pen)

Setter
set the textfont of me
to NewValue

me (a Pen)
to (a Font)

See Also

drawString .

textsize of Pen
Stores the point size of the text to be used to draw text with the Pen. Should be an Integer.

Getter
get the textSize of me

me (a Pen)

Setter
set the textsize of me
to NewValue

me (a Pen)
to (an Integer)

Page 510
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t e x t s t y l e o f P e n

See Also

drawString .

textstyle of Pen
Stores the text style used to draw text with the pen. Specified as a list of styles.

Getter
get the textStyle of me

me (a Pen)

Setter
set the textstyle of me
to NewValue

Specifies the style the pen uses to draw its text with drawString .

me (a Pen)
to: A list of styles.

See Also

drawString .

v of Pen
The vertical position of the pen. Should always be an integer.

Getter
get the v of me

me (a Pen)

Setter
set the v of me
to NewValue

me (a Pen)
to (an Integer)

Page 511
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w i d t h o f P e n

See Also

location .

width of Pen
The horizontal component of the pen's size .

Getter
get the width of me

me (a Pen)

Setter
set the width of me
to NewValue

me (a Pen)
to (an Integer)

See Also

size .

Handlers of pen

deinstall of Pen
deinstall me
This handler makes the pen stop being the current pen used for drawing. It is used by the
with pen handler which provides a more convenient interface.

Note: There should be no need to use this handler, since with pen does it all.◆

me (a Pen)

See Also

with pen .

Page 512
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d r a w s t r i n g o f P e n

drawstring of Pen
drawString me, thestring
Draws the string provided starting at the current location of the pen.
Note: Assumes that the pen has been installed (eg. by calling this handler from the body
of a with pen ). If the pen is not installed, the operation has no effect.◆

me (a Pen)
thestring (a String)

See Also

with pen .

framemask of Pen
frameMask me, themask
Draws the outline of the mask provided.

me (a Pen)
themask (a Mask)

frameoval of Pen
frameOval me, therect
Given a boundsRect, it draws the outline of the oval that can be inscribed in it.

me (a Pen)
therect: A list of four numbers of the form {left, top, right,
bottom} .

framerect of Pen
frameRect me, therect
Draws the outline of the boundsRect provided.

me (a Pen)
therect: A list of four numbers of the form {left, top, right,
bottom} .

Page 513
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n s t a l l o f P e n

install of Pen
install me, thepaper
Installs the pen for drawing. This handler installs all the setting you have saved in the pen
into the system's pen. There is commonly no need to call this handler since with pen will
do it for you.
Note: If you call this handler, make sure to deinstall the pen when you are done or
you can seriously confuse the graphics system.◆

me (a Pen)
thePaper: The surface on which the pen is to be installed. The "thePaper"
argument that is passed to the render handler should be used for this
argument.

See Also

deinstall , with pen .

installed of Pen
installed me
Returns True is the pen is the one currently used for drawing. This will be the case within
the body of a with pen .

me (a Pen)

See Also

with pen .

lineto of Pen
lineTo me, h, v
Plots a line from the current position of the pen to the point specified with the h and v
arguments.
Note: No drawing takes place if the pen is not installed .◆

me (a Pen)
h (an Integer): The horizontal position of the end of the line.
v (an Integer): The vertical position of the end of the line.

Page 514
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p a i n t m a s k o f P e n

paintmask of Pen
paintMask me, themask
Fills the mask provided with the pen's ink .

me (a Pen)
themask (a Mask)

See Also

ink .

paintoval of Pen
paintOval me, therect
Given a rectangle, it fills the oval that can be inscribed in it with the pen's ink .

me (a Pen)
therect (a Rectangle): As a list of four points: {left,top,right,bottom} .

See Also

ink .

paintrect of Pen
paintRect me, therect
Paints the rectangle specified with the pen's ink .

me (a Pen)
therect (a Rectangle): As a list of four points: {left,top,right,bottom} .

See Also

ink .

resetpen of Pen
resetPen me
This handler resets the pen currently used for drawing.
Note: If you use the system's pen (the object Pen itself) for drawing you should call this
handler when you are done to reset the pen. If you do not do so, brace yourself for some
possibly very interesting visual effects.◆

Page 515
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s t r i n g s i z e o f P e n

me (a Pen)

stringsize of Pen
stringSize me, thestring
Given a string, this handler tells you how many pixels would be required to draw the
string with the current settings of the pen.

me (a Pen)
thestring (a String)

Picker
(a Rectangle, PickerCollection)

The Picker is used to display and manipulate lists of items as lines of text. Each item in the Picker can
be an arbitrary object. A text representation of each item appears on each line of the picker. The Picker
supports scrolling of the list, and selection of items in it (both single and multiple selection), and other
capabilities.
The Picker has the following properties that you may customize:
(1) the ways in which it selects items
(2) the spacing between lines
(3) whether to sort the items alphabetically or not, and
(4) what text to use to represent each item.
Picker includes an automatic completion mechanism that moves the selection to match a string entered
by the user (the Picker is fast enough to do the update at each character typed).

Example
To create a simple picker on the Stage whose items are the numbers 100, 200, 300:
new Picker with container Stage with items {100,200,300} with location
{100,100}

See Also
items , createTextDisplayItem , alphabeticalDisplay and TextList , IconPicker and
StyledPicker.

Page 516
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a l p h a b e t i c a l d i s p l a y o f P i c k e r

Properties of Picker

alphabeticaldisplay of Picker
Controls whether the items displayed in the picker are sorted alphabetically. The default
value is True .
Note: what is really sorted is the list of strings that represent each item. These strings are
obtained by calling createTextDisplayItem . If your createTextDisplayItem
handler calls objectString on each item (instead of calling simpleObjectString ),
the sorting might have subtle unexpected results.
Consider, for example, setting the items of your picker to the list {"Foo", "Foo Bar"} .
Calling createTextDisplayItem (which in this anomalous case is calling
objectString ) yields the list {"\"Foo\"", "\"Foo Bar\""} . The problem when
sorting is that the character \" is greater than the space character and thus, "\"Foo
Bar"\" is less than "\"Foo\"" . The items in your picker will then appear in the wrong
order: {"Foo Bar", "Foo"} .
To fix this problem use simpleObjectString instead of objectString .◆

Getter
get the alphabeticalDisplay of me

me (a Picker)

Setter
set the alphabeticaldisplay of me
to NewValue

me (a Picker)
to (a boolean)

See Also

createTextDisplayItem , objectString and simpleObjectString of Object .

items of Picker
Specifies the items that the picker displays. Note that what appears in the picker is not
the item itself but a textual representation of it. This representation is created by calling
the createTextDisplayItem handler on each item. The default handler uses the
objectString of each item.

Page 517
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l i n e s p a c i n g o f P i c k e r

Getter
get the items of me

me (a Picker)

Setter
set the items of me
to NewValue

Sets the items of the Picker. Each item occupies one line of the Picker. After the items have
been set the partnerScroller (if any) is udpated.

me (a Picker)
to: A list of things.

See Also

objectString , createTextDisplayItem and updatePartnerScroller.

linespacing of Picker
This property specifies how much blank space the picker leaves between consecutive
items. The default is 3 pixels.

Getter
get the lineSpacing of me

me (a Picker)

Setter
set the linespacing of me
to NewValue

me (a Picker)
to (an Integer)

partnerscroller of Picker
This property specifies the vertical scroller, if any, that is associated to the picker to control
the verticalScroll property.

Page 518
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p a r t n e r s c r o l l e r o f P i c k e r

Getter
get the partnerScroller of me orientation

me (a Picker)
orientation: Ignored.

Setter
set the partnerscroller of me
to NewValue

Makes a scroller and a picker work together.

There are two parts to a fruitful relationship between these two objects: (1) a handler that
hooks up the right properties using ports and (2) an update handler that keeps the scroller
appraised of changes in the picker that concern it (for example, when the number of items
in the picker changes, so should the range in the scroller).

The properties we will connect are the currentValue of the scroller and the
verticalScroll of the picker. Thus, when the currentValue changes, the picker
scrolls in the right direction. Notice that the connection should be bidirectional since
changing the verticalScroll of the picker by mousing on items should update the
scroller as well.

me (a Picker)
to: A Scroller or False , to disconnect the picker from its old
partnerScroller.

Example
Below we show a slightly simplified version of the actual handler that connects the picker
and the scroller in all its glory. The work is divided in three parts: disconnect the scroller
from the previous thing it was controlling, connect it the the picker, and store the scroller
in the vScroller property of the Picker. Our simple method obviates the first step.
It is important to record who the scroller is in a property because the
updatePartnerScroller handler of the picker will be called repeatedly to keep them
in synch.
Note that the safe ports are used (SafeInputPort and SafeOutputPort ). This is
because the connection is bidirectional and we want to detect loops.

Page 519
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p a r t n e r v s c r o l l e r o f P i c k e r

on set partnerScroller of me (a Picker) to theScroller


-- Maybe the ports are there already. Check that out.
set inPort to findPort(me, 'verticalScroll', 'input')
set outPort to findPort(me, 'verticalScroll', 'output')
set scroInPort to findPort(theScroller, 'currentValue', 'input')
set scroOutPort the findPort(theScroller, 'currentValue',
'output')
-- If we did not find ports, we make them!
unless inPort do
addInputPort me, 'verticalScroll' with prototype SafeInPutPort
end unless
unless outPort do
addOutputPort me, 'verticalScroll' with prototype
SafeOutPutPort
end unless
unless scroInPort do
addInputPort theScroller, 'currentValue' with prototype
SafeInputPort
end unless
unless scroOutPort do
addOutputPort theScroller, 'currentValue' with prototype
SafeOutputPort
end unless
-- Now wire them!
wirePorts outputPort, scroInPort
wirePorts scroOutPort, inPort
-- Install scroller in the vScroller slot of the picker.
set my vScroller to theScroller
end set partnerScroller
Of course, all this would be easier if we had just used an InputOutputPort .

See Also

SafeInputPort , SafeOutputPort , findPort and updatePartnerScroller.

partnervscroller of Picker

Getter
get the partnerVScroller of me

The picker knows how to associate with a scroller. The partnerVScroller property
returns the associated scroller. Setting the property hooks up the scroller and the picker,
doing all the required work. This handler calls set partnerScroller to do the work.

me (a Picker)

Page 520
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e l e c t e d i t e m s o f P i c k e r

Setter
set the partnervscroller of me
to NewValue

me (a Picker)
to: A scroller or False .

See Also

set partnerScroller.

selecteditems of Picker
This property specifies which items in the picker are selected.

Getter
get the selectedItems of me
with indices

me (a Picker)
[with indices] (a boolean): If True , this handler returns a list of the positions
of the selected items (instead of the items themselves). The default is
False .

Setter
set the selecteditems of me
with upwards
with deselecting
to NewValue

Sets the items that are to be selected in the Picker.

Every item in the list specified in the to argument is selected in accordance with the
picker's selectionStyle . For example, only the first item is selected if the
selectionStyle is 'single' .

Page 521
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e l e c t i o n o f P i c k e r

me (a Picker)
[with upwards] (a boolean): If True , the first item selected is shown at the
end of the operation. Otherwise the last item selected is shown.
[with deselecting] (a boolean): If True , the new items replace the old
selection. Otherwise, the new items are added to the current selection.
Defaults to False .
to: A list of items than are already in the picker's items or False to deselect
everything.

See Also

selection , selectionStyle , selectedItems , items .

selection of Picker
This property specifies which items in the picker are selected. It differs from
selectedItems in that it talks about the items to be selected using their positions in the
items of the picker (as opposed to refering to the items themselves).

Getter
get the selection of me

me (a Picker)

Setter
set the selection of me
with upwards
with deselecting
to NewValue

Sets the items that are to be selected in the Picker. This setter can be used in two different
forms: by specifying with a list of two indices the whole range to be selected or by passing
in a symbol that selects specific items in the picker.

If you choose to pass a symbol, the options are: 'first' (select the first item in the
picker), 'last' (the last item), 'next' (the item that follows the current selection) and
'previous' (the item that precedes the current selection).

Page 522
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e l e c t i o n s t y l e o f P i c k e r

me (a Picker)
[with upwards] (a boolean): If True , the first item selected is shown at the
end of the operation. Otherwise the last item selected is shown.
[with deselecting] (a boolean): If True , the new items replace the old
selection. Otherwise, the new items are added to the current selection.
Defaults to False .
to: Either one of the symbols 'first' , 'last' , 'previous' and 'next'
or a list of 2 integers specifying the start and end of the range to be
selected.

See Also

selectionStyle , selectedItems , items .

selectionstyle of Picker
This property determines how the the picker handles selection. There are three selection
modes:
'single' : only one item can be selected at a time.

'contiguous' : multiple contiguous items can be selected at a time.

'discontiguous' : multiple discontiguous items can be selected at a time.

Getter
get the selectionStyle of me

me (a Picker)

Setter
set the selectionstyle of me
to NewValue

me (a Picker)
to: One of 'single' , 'contiguous' and 'discontiguous' .

verticalscroll of Picker
Specifies the position of the first item currently shown in the picker's items. Setting this
property actually scrolls the picker so that the first item displayed is the item at the
position specified by the numeric argument.

Page 523
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a d d i t e m s o f P i c k e r

Getter
get the verticalScroll of me

me (a Picker)

Setter
set the verticalscroll of me
to NewValue

me (a Picker)
to (an Integer)

Handlers of Picker

additems of Picker
addItems me, itemlist
This handler appends the items in itemList to the items in the picker. This handler is
used when you just want to add items to the end of the picker.

me (a Picker)
itemlist: A list of things to add to the picker's items .

See Also

items .

autokey of Picker
autoKey me, thechar
If the character is the upArrow or the downArrow, this handler moves the picker's
selection accordingly. Otherwise the inherited handler gets called.

me (a Picker)
thechar (a Character)

Page 524
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o p y s e l e c t i o n t o c l i p b o a r d o f P i c k e r

copyselectiontoclipboard of Picker
copySelectionToClipBoard me
Adds the currently selected items to the SK8Clipboard without copying them.

me (a Picker)

See Also

addToClipboard of Object .

createtextdisplayitem of Picker
createTextDisplayItem me, theobject
The createTextDisplayItem handler is called to get the string based representation of
each item in the picker's items . The default is to return the object's
simpleObjectString , but you can redefine this handler to return any arbitrary string.

me (a Picker)
theobject: The item whose string based representation we need.

Example
Consider a picker called DoubleNamesPicker which represents each item by writing its
simpleObjectString twice. We would write the following:
on createTextDisplayItem of (me (a DoubleNamesPicker), theObject)
set theName to theObject's simpleObjectString
return theName & theName
end createTextDisplayItem

See Also

simpleObjectString of Object .

element of Picker
element me, index
Returns the item at the position specified by index.

me (a Picker)
index (an Integer)

Page 525
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e x t e n d e d m o u s e d o w n o f P i c k e r

See Also

items .

extendedmousedown of Picker
extendedMouseDown me
The default behavior is to do nothing.

me (a Picker)

findandselect of Picker
findAndSelect me, partialstring
The findAndSelect handler searches through the picker's items to find the first item
whose string representation starts with partialString . When the item is found, the
picker scrolls to it. This handler is called by the picker's built in search mechanism.

me (a Picker)
partialstring

flashitem of Picker
flashItem me
Flashes the selected items of the picker.

me (a Picker)

flashline of Picker
flashLine me
Flashes the selected row of the picker.

me (a Picker)

getitemposition of Picker
getItemPosition me
Returns the position of the item that is currently under the mouse in the picker's items ,
bound by 0 and the number of items in the picker.

Page 526
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
g e t l i n e p o s i t i o n o f P i c k e r

me (a Picker)

getlineposition of Picker
getLinePosition me
Returns the position of the item under the mouse in the picker's items. If no items are
under the mouse it returns the number of items in the picker.

me (a Picker)

itemboundsrect of Picker
itemBoundsRect me, index
with physical
Returns a list of 4 numbers representing the bounds rect of the cell for the item at the
given index.

me (a Picker)
index (an Integer): The position of the item we are interested in.
[with physical] (a boolean): If True, the bounds rect is returned in Stage
coordinates.

itemvisible of Picker
itemVisible me, item
Returns whether item is currently visible in t