Professional Documents
Culture Documents
ð
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.
Table of Contents
Page iii
ð
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
ð
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
ð
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
ð
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
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
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
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
See Also
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
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
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
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.
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
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
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.
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 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:
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
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
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
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
me (an Actor)
to (a Number)
See Also
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
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 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
me (an Actor)
to (a Number)
See Also
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
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
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
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
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
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
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
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
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
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
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' .
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.
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
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
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
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
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
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
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
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
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
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
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
me (an Actor)
Setter
set the textoffset of me
to NewValue
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
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
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
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
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
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
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
me (an Actor)
[with physical] (a boolean)
to (a Number)
See Also
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
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 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
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
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
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
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
See Also
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
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
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 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
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 .
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
incrementOwnsRegionCount of Actor
incrementOwnsRegionCount me
Indicates that ownsRegion is to return True and ownedRegion needs to be maintained.
me (an Actor)
See Also
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
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
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
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
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
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.
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
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
mouseleave of Actor
mouseLeave me
Called on the actor whenever the pointer leaves the actor's bounds.
me (an Actor)
See Also
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
sendtoback of Actor
sendToBack me
The sendtoback handler moves the actor to the deepest layer of its container.
me (an Actor)
See Also
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
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
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
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
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
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 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
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
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
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 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
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
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
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)
Properties of AppleEventError
description of AppleEventError
<private>
Getter
get the description of me
Setter
set the description of me
to NewValue
AppleEventReceiver
(an Object)
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
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)
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)
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
me (a Arrow)
Setter
set the endarrow of me
to NewValue
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
me (a Arrow)
Setter
set the startarrow of me
to NewValue
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
BrowserComponent
(an Object)
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
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
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
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
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
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
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
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
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
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)
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
nthItem of Collection
Getter
get the nthItem of me 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)
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
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
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
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
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
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
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 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
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
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
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
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 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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)
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' .
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
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' .
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
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.
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
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
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
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
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
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)
Example
set the inputProject of the Picker of SuperCoolConstantSheet to SK8
ConstantSheetPicker
(a ProjectDataSheetPicker)
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
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
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
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
me (a [[DateTime]])
Setter
set the pm of me
to NewValue
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
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
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
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)
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
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
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
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
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
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
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
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 .
me (an EditText)
See Also
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
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
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
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
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
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)
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)
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
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
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
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
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.
me (a File)
Setter
set the filedirectory of me
to NewValue
me (a File)
to
See Also
fileType , fileDevice .
filetype of File
Getter
get the fileType of me
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
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
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"
me (a File)
to
Example
set myfile to a new file with logicalname "SK8;directory:foo"
--> the File "SK8;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
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
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
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
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
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
mouseleave of FileChooser
mouseLeave me
Sets the cursor of the Stage to the StandardCursor.
me (a FileChooser)
See Also
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)
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)
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)
Example
set the inputProject of the Picker of SuperCoolFunctionSheet to SK8
FunctionSheetPicker
(a ProjectDataSheetPicker)
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)
HandlerSheet
(a TextList)
Example
set the inputObjects of the Picker of SuperCoolHandlerSheet to {rectangle,
oval, roundrect}
HandlerSheetPicker
(a PropertyHandlerSheetPicker)
HandlerViewer
(a TextList)
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)
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
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.
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
HierarchicalObjectList
(a TextList)
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)
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
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
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 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
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
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
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
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
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)
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
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
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 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
MemHandle
(a ForeignMemory)
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)
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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)
MenuForFunPickers
(a PDPMenu)
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)
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
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
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)
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)
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
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)
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).
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
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 '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 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
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
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
me (an Object)
parents: Should be a list of parents to replace the current parents of the
object.
See Also
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 .
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 .
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
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 .
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
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
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 .
See Also
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.
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
inheritedHandlers of Object
inheritedHandlers me
Returns all of the handlers inherited by the object from its ancestors. This is a list of
handler objects.
See Also
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.◆
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
See Also
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
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 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
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
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.
See Also
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
me (an Object)
See Also
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
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
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
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.
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
See Also
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.
See Also
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.
See Also
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.
See Also
outputPorts of Object
outputPorts me
Returns a list of the OutputPorts currently attached to this Object.
me (an Object)
See Also
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
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
me (an Object)
See Also
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
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.◆
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
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
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)
ObjectPile
(a TextList)
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)
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)
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' .
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
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
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
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
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
See Also
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
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 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 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.
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 the picker.
me (a Picker)
item: Should be an item in the picker's items .
keydown of Picker
keyDown me, thechar
This handler is called when the user keys in a character in the keyboard and the picker is
the keyTarget of its window. The default handler moves the selected item up and down
when the upArrow and downArrow keys are pressed, and also implements the picker's
completion mechanism.
Page 527
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
k e y u p o f P i c k e r
me (a Picker)
thechar (a Character)
See Also
keyTarget .
keyup of Picker
keyUp me, thechar
This handler is called when the user releases a key on the keyboard. Unless the character
is Tab and the picker is autotabable, the selectionCompleted handler is called.
me (a Picker)
thechar (a Character)
See Also
selectionCompleted .
mousedown of Picker
mouseDown me
This handler gets called when the mouse goes down on the picker. It does the following:
(1) If the picker is not already the keyTarget of its window, it makes it be.
(2) It checks if the user holds the mouse on one item for .4 seconds. If so, the
extendedMouseDown handler gets called to take over.
(3) If extendedMouseDown returns False , or was not called at all, the handler tracks the
mouse position in order to allow for the selection of the item under the mouse and
scrolling of the picker's items .
me (a Picker)
See Also
extendedMouseDown .
mouseup of Picker
mouseUp me
The picker's mouseUp handler determines when to send clicks or doubleclicks to the
picker. The picker only gets a doubleClick if both clicks happened on the same item.
Page 528
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 P i c k e r
Among other things, this handler records (in the lastSelected property) the item that
was selected when the mouseUp happened.
me (a Picker)
pointonwhichpart of Picker
pointOnWhichPart me, x, y
with part
with tracking
If the part argument equals 'item' , this handler returns the position of the item under
the {x,y} point. Otherwise, the actor pointOnWhichPart handler is called. The point
is assumed to be provided in Stage coordinates.
me (a Picker)
x (an Integer): The horizontal position of interest in Stage coordinates.
y (an Integer): The vertical position of interest in Stage coordinates.
[with part]: Can be 'item' or any of the actor options.
[with tracking] (a boolean): If True only the vertical coordinate is used to
compute the item (it is assumed that the horizontal coordinate falls
within the picker).
See Also
pointOnWhichPart of Actor.
resized of Picker
resized me
This event is sent each time an picker's boundsRect is set with the justMoving flags set
to False (the default). This handler updates the picker's partnerScroller if any (calls
the udpatePartnerScroller handler).
me (a Picker)
See Also
updatePartnerScroller.
selectall of Picker
selectAll me
Select all the items in the picker.
Page 529
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 P i c k e r
me (a Picker)
selectioncompleted of Picker
selectionCompleted me
This handler is called when the system determines that the selection process is complete.
The idea is to let the picker know that the selection has changed because the picker might
want to perform some action at this point. The selection is considered complete when the
user releases the mouse or a key (that is, the default picker mouseUp and keyUp handlers
call this handler).
Consider the SK8 Object Browser. It updates the properties and values panels whenever
the selection changes. Since this can take time, you don't want to do do it when you're
scrolling in the Objects panel with the mousedown -- you want to do it when the selection
ends. Thus, this handler is redefined to update other panels.
me (a Picker)
size of Picker
size me
with how
with physical
This handler returns the number of items visible at one time in the picker or the actor's
size handler is called. The how argument specifies which size you want to determine.
The options are:
'items' : returns the number of items that are FULLY visible in the picker at any time.
'partialItems' : the number of items that can be seen in the picker at any time. In this
count we include items that are only partially visible. This will differ from the size in the
previous option by 1 item.
False : the Actor size is invoked.
me (a Picker)
[with how]: One of 'items' , 'partialItems' or False .
[with physical] (a boolean): Specifies whether you want the size in pixels.
Only considered when the how option is False .
See Also
size of Actor.
Page 530
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s i z e o f P i c k e r
PickerCollection
(a Collection)
A collection object that is mixed in with Picker to implement the collection protocol for pickers.
PickerMenu
(a Menu)
This object provides the ability to quickly make simple popup menus. It does this with the same core
API used by the Picker object. There is an items property which specifies the list of choices. The user
can write a menuSelect handler on the menu and use the selectedItem property to make use of what
happens when the user chooses a particular item.
Note that the items of the PickerMenu are created dynamically, every time on update . Thus, if you
wish to alter the characteristics of one of the items (like add a checkmark ), you must do so in the update
handler. See update of PickerMenu for an example of this.
Example
The following makes a picker menu that lets the user choose a colordepth for a paint window. Note that
the items correspond to the number of bits of color, while the text of the items refer to the total number of
colors.
new PickerMenu with objectname "ColorDepthMenu"
set the items of the ColorDepthMenu to {1, 2, 4, 8}
on CreateTextDisplayItem of me (a ColorDepthMenu), theitem
set numberofcolors to 2^theitem --- This gets the number of colors
return (numberofcolors as a number & " Colors")
end CreateTextDisplayItem
on MenuSelect of me (a ColorDepthMenu)
set the colorDepth of the PaintArea to my selectedItem
end MenuSelect
on Update of me (a ColorDepthMenu)
do inherited ---- This creates a PickerMenuItem for each of the items.
---This next line puts a checkmark next to the the item corresponding to
the current color depth.
set the checkmark of every item whose item = the colorDepth of the
PaintArea in my menuitems to true
end Update
Page 531
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i t e m s o f P i c k e r M e n u
See Also
PickerMenuItem
Properties of PickerMenu
items of PickerMenu
This property controls the items of the menu. Note that menu items are created
dynamically in the Update handler, therefore the user can redefine the getter handler of
this property to dynamically compute the items. This way, whenever the user pop ups up
the menu, the menus items can be updated automatically.
Getter
get the items of me
Setter
set the items of me
to NewValue
Example
Here is a redefinition of the getter handler which will always keep the menu in synch with
the windows on the screen:
on items of me (a WindowPickerMenu)
return the contents of the stage
end items
maximumLength of PickerMenu
This property specifies the limit (if any) to the number of items the popup can display.
Note this limit only exists when using AddItems .
Getter
get the maximumLength of me
Setter
set the maximumlength of me
to NewValue
Page 532
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e l e c t e d I t e m o f P i c k e r M e n u
selectedItem of PickerMenu
This property is set to the item last selected by the user. This can be used in the
menuSelect handler of the pickerMenu to find out what the user chose.
Getter
get the selectedItem of me
Setter
set the selecteditem of me
to NewValue
Handlers of PickerMenu
additem of PickerMenu
addItem me, newitem
This handler can be used to push an item into the items list. It ensures that there are at
most maximumLength items in the menu.
me (a PickerMenu)
newitem
createTextDisplayItem of PickerMenu
createTextDisplayItem me, theitem
This handler acts similarly to the handler of the same name of the Picker. This handler
is used to convert the objects into the strings used by the menuitems . By default this
handler checks to make sure that the item is not already a string. If not, then it gets the
objectstring of the item.
me (a PickerMenu)
theitem
update of PickerMenu
update me
Page 533
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i t e m o f P i c k e r M e n u I t e m
This does most of the work of the pickerMenu . On update the menu checks it's items
property and creates a menu item for each item using the handler
CreateTextDisplayItem to generate the text of the menuitem . Note that if there are
items in the pickerMenu which are not dynamically created, they will remain at the top
of the menu and the items will appear beneath.
me (a PickerMenu)
PickerMenuItem
(a MenuItem)
This is the prototype menu item that the picker menu uses when dynamically updating the menu to
include the items in the pickerMenu 's items property.
See Also
menuselect
Properties of PickerMenuItem
item of PickerMenuItem
This property is set by the PickerMenu when creating this object to associate it with one
of the items.
Getter
get the item of me
Setter
set the item of me
to NewValue
Page 534
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m e n u s e l e c t o f P i c k e r M e n u I t e m
Handlers of PickerMenuItem
menuselect of PickerMenuItem
menuSelect me
This sets the selected item of the pickerMenu to it's item, calls the inherited handler and
then clears the other menuitems values. The reason it clears the other values is to ensure
that these objects can be garbage collected.
me (a PickerMenuItem)
PickerMenuItemSpacer
(a PickerMenuItem)
This is the prototype menu item spacer that the PickerMenu uses when differentiating it's static menu
items the user has added from the ones that were dynamically created by setting the pickerMenu's items
property.
PixelMap
(a Media)
The object representing pixmaps. It is used to store images of actors (captured using capturePicture ).
See Also
capturePicture .
Page 535
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 P i x e l M a p
Handlers of PixelMap
capturepicture of PixelMap
capturePicture me, otheractor
with size
with backgroundrenderer
This handler is called by CapturePicture of ImageRenderer to do the real work.
me (a PixelMap)
otheractor: The Actor (or Renderer) to be captured.
[with size]: The size at which to cache the picture.
[with backgroundrenderer]: The renderer to use as background for the
capture.
See Also
capturePicture of ImageRenderer.
defaultrenderstyle of PixelMap
defaultRenderStyle me
Returns the way in which a media of this type is commonly rendered. For the pixelMap,
this handler returns 'renderStretched' .
me (a PixelMap)
renderstretched of PixelMap
renderStretched me, therenderer, theactor, region, thepaper
Renders the image in the pixelMap stretching it to fill the region to be rendered.
me (a PixelMap)
therenderer (an ImageRenderer): The renderer whose media is this pixelMap.
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.
Page 536
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e n d e r t i l e d o f P i x e l M a p
rendertiled of PixelMap
renderTiled me, therenderer, theactor, region, thepaper
Renders the image stored in the pixelMap tiling it to fill the region to be painted.
me (a PixelMap)
therenderer (an ImageRenderer): The renderer whose media is this pixelMap.
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 PixelMap
renderUnstretched me, therenderer, theactor, region, thepaper
Renders the image stored in the pixelMap 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 (a PixelMap)
therenderer (an ImageRenderer): The renderer whose media is this pixelMap.
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 PixelMap
size me
Returns the size the pixelMap has used to cache its picture.
me (a PixelMap)
Pointer
(a Device)
Page 537
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p o i n t e r s t a t e o f P o i n t e r
Prototype for pointer-style user interface devices (e.g., a stylus, a mouse) currently connected to the
system.
The knownChildren of this object are the pointers currently connected to your system.
Handlers of Pointer
pointerstate of Pointer
pointerState me
The default behavior is to return 'down' or 'up', based on the current state of the mouse
button.
me (a Pointer)
See Also
Polygon
(an Actor)
A polygon is an actor whose geometry is defined by a set of points . The points are provided as a a list
of alternating horizontal and vertical values in logical coordinates.
In addition to being moved and resized, polygons can also be rotated.
See Also
points , rotate , angle .
Page 538
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a n c h o r o f P o l y g o n
Properties of Polygon
anchor of Polygon
The anchor of a polygon is its center of rotation, the point about which the polygon
rotates. The point is specified in logical coordinates.
Note: If the polygon's anchor is False (the default), the location is used for this
purpose.◆
Getter
get the anchor of me
me (a Polygon)
Setter
set the anchor of me
to NewValue
me (a Polygon)
to: A point as a list of the form {h,v} . If you want to set the anchor to
False , use the list {False, False} .
See Also
rotate .
angle of Polygon
This property stores the current angle of rotation of the polygon. Changing the angle
rotates the polygon. The angle is expressed in radians (2pi radians = 360 degrees).
Note: The angle is reset to 0 whenever the polygon's points are set explicitely. (This can
only happen by setting the points or by setting the nthPoint .) Thus, 0 is considered the
natural angle of a polygon.◆
Getter
get the angle of me
me (a Polygon)
Page 539
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h a n c h o r o f P o l y g o n
Setter
set the angle of me
to NewValue
Sets the angle of the polygon the the angle specified. The polygon rotates itself to conform
to the new angle. Calls rotate to do the work.
me (a Polygon)
to (a Number): The new angle, specified in radians (2pi radians = 360
degrees).
See Also
hanchor of Polygon
Specifies the horizontal coordinate of the polygon's anchor.
Getter
get the hAnchor of me
me (a Polygon)
Setter
set the hanchor of me
to NewValue
me (a Polygon)
to (a Number): The new hAnchor. Assumed to be in logical coordinates.
See Also
anchor.
nthpoint of Polygon
This property can be used to individually manipulate one point of the polygon's points .
Getter
get the nthpoint of me n
Page 540
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p o i n t s o f P o l y g o n
me (a Polygon)
n (an Integer): The point we are interested in.
Setter
set the nthpoint of men
with physical
with relative
to NewValue
Allows you to change just one of the polygon's points. Calls setNthPoint to do the
work. Notice that the angle will be reset to 0.
me (a Polygon)
n (an Integer): The position of the point we want to set.
[with physical] (a boolean): If True the point is assumed to be given in
physical coordinates.
[with relative] (a boolean): If True , the point is assumed to be an offset from
the current point.
to: The new value for the point, as a list of numbers of the form {h,v} .
See Also
points of Polygon
Specifies the points that define this polygon as a list of the form
{h1,v1,h2,v2,...,hn,vn} .
Note: You should always provide a minimum of three points. A polygon is a region
inside three points.◆
Getter
get the points of me
with physical
me (a Polygon)
[with physical] (a boolean): If True , the points are returned in Stage
coordinates.
Page 541
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
v a n c h o r o f P o l y g o n
Setter
set the points of me
with physical
to NewValue
Sets the points of the polygon to the points specified. Causes the angle to be reset to 0.
me (a Polygon)
[with physical] (a boolean): If True the points are assumed to be given in
Stage coordinates.
to: A list of points. At least 3 points (6 numbers) are expected.
See Also
angle , nthPoint .
vanchor of Polygon
Specifies the vertical component of the polygon's anchor.
Getter
get the vAnchor of me
me (a Polygon)
Setter
set the vanchor of me
to NewValue
me (a Polygon)
to (a Number): The new vertical location of the anchor, expected in logical
coordinates.
See Also
anchor.
Page 542
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 P o l y g o n
Handlers of Polygon
addedmeasparent of Polygon
addedMeAsParent me, child, oldparents
This handler performs all the work required to turn an object into a Polygon .
me (a Polygon)
child
oldparents
See Also
addedMeAsParent of Object .
getshapefromuser of Polygon
getShapeFromUser me
with starth
with startv
with style
with multipledraw
with boundsrectset
This handler provides a direct manipulation interface to obtain the points of a polygon. It
should be invoked within a mouseDown event, at which point it lets the user draw the
polygon in a variety of ways. When the mouse is released, this handler returns the points
of the polygon specified.
If startH and startV are not given, the current location of the mouse is used for the first
point. This is good enough in most cases. You may provide different values to override.
Your values will be expected in Stage coordinates.
Page 543
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n i t i a l i z e o f P o l y g o n
me (a Polygon)
[with starth] (an Integer): The horizontal location of the start point in Stage
coordinates.
[with startv] (an Integer): The vertical location of the start point in Stage
coordinates.
[with style]: Specifies how the polygon is to be drawn. The default is
'Points' , which means that each click sets one point of the polygon
until you doubleClick. 'Regular' only lets you draw regular
polygons. The first point is taken to be the polygon's center. You can use
the number keys to set the number of sides you want in the Polygon
(from 3 to 10 and above using the + and - keys). 'FreeHand' turns the
cursor into a pencil and lets you draw an area. 'Symetrical' and
'Symegon' are very exciting: try them!
[with multipledraw]: Ignored.
[with boundsrectset] (a boolean): If True , the points of the polygon passed
in the me argument are set to the points obtained by direct manipulation.
Example
Here is a handler for a Rectangle that, on mousedown , allows you to draw a polygon and
then creates it with the shape specified and puts it within its contents.
on mouseDown of bingham (a Rectangle)
set pointlist to getShapeFromUser polygon ¬
with startH eventH ¬
with startV eventV ¬
with style 'FreeHand'
lock me
set polly to new polygon
set the container of polly to me
set the points of polly to pointlist
unlock me
end mouseDown
initialize of Polygon
initialize me, original, isnew, initargs
Does the inherited handler and then copies the points from the original.
me (a Polygon)
original
child
args
Page 544
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 P o l y g o n
See Also
initialize of Object .
makeboundsregion of Polygon
makeBoundsRegion me
Computes the Polygon's boundsRegion
me (a Polygon)
makefillregion of Polygon
makeFillRegion me
Computes the Polygon's fillRegion .
me (a Polygon)
makeframeregion of Polygon
makeFrameRegion me
Computes the Polygon's frameRegion .
me (a Polygon)
rotate of Polygon
rotate me, angle
with relative
with physical
with hanchor
with vanchor
Rotates the unrotated version of the polygon by the angle specified. The center of rotation
is the point specified by the hAnchor and vAnchor arguments if given. If not, the
polygon's anchor is used.
If the polygon's anchor is False , its location is used instead. Notice however that as
you rotate the polygon its location will change slightly causing the polygon to
eventually move in its container. In general you should make sure the anchor is set
before attempting multiple rotations. This is shown in the example below.
Page 545
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e t b o u n d s r e c t o f P o l y g o n
Note: if you repeatedly call this handler with the same value in the angle argument and
you expect your polygon to be rotating and it is not, make sure you say with
relative .◆
me (a Polygon)
angle (a Number): The new angle to rotate to. Should be specified in radians
(2pi radians = 360 degrees).
[with relative] (a boolean): If True , the angle is added to the current angle
of the polygon. Otherwise (the default), the angle is set to the angle
specified.
[with physical] (a boolean): If True , the hAnchor and vAnchor arguments
are assumed to be given in Stage coordinates.
[with hanchor] (a Number): The horizontal center of rotation to override the
polygon's current hAnchor.
[with vanchor] (a Number): The vertical center of rotation to override the
polygon's current vAnchor.
Example
Consider a polygon sitting somewhere on an actor. The following mousedown handler
makes the polygon rotate 360 degrees in 20 steps.
on mousedown of me (a RotatingPolygon)
set oneStep to 2 * pi / 20
set my anchor to my location
repeat 20 times
rotate me, oneStep with relative
end repeat
end mousedown
setboundsrect of Polygon
setBoundsRect me, left, top, right, bottom
with physical
with relative
with justmoving
Does the inherited handler to set the bounds and then maps the polygon's points to the
new boundsRect.
Page 546
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e t n t h p o i n t o f P o l y g o n
me (a Polygon)
left (a Number): The horizontal position of the left of the polygon's
boundsRect.
top (a Number): The vertical position of the top of the polygon's boundsRect.
right (a Number): The horizontal position of the right of the polygon's
boundsRect.
bottom (a Number): The vertical position of the bottom of the polygon'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 polygon is going to change
size as a result of this operation. If the polygon will not change size,
this argument should be True .
See Also
setBoundsRect of Actor.
setnthpoint of Polygon
setNthPoint me, n, h, v
with physical
with relative
Sets the nth point of the polygon to the values specified in the h and v arguments.
me (a Polygon)
n (an Integer): The point we want to modify.
h: The new horizontal location of the nth point.
v: The new vertical location of the nth point.
[with physical] (a boolean): If True the h and v arguments are assumed to
be given in Stage coordinates.
[with relative] (a boolean): If True , the new point is assumed to be an offset
from the old location of the point.
See Also
nthPoint .
Page 547
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e t r e g u l a r p o l y g o n o f P o l y g o n
setregularpolygon of Polygon
setRegularPolygon me
with numsides
with radius
with phase
This handler transforms the polygon into a regular polygon, with the handler's numSides
argument specifying the number of sides to the polygon. The Polygon's radius and
rotation can be set through the optional radius and phase arguments.
me (a Polygon)
[with numsides]: The number of sides desired. If not specified, the current
number of sides is used.
[with radius]: The distance from the current location of the polygon to each
vertex in the regular form of the polygon.
[with phase]
Port
(an Object)
A Port is a SK8 object that allows a change in a Property's value to cause side effects; most typically,
setting the value of a Property of another Object.
Ports are attached to individual Object instances. The following figure illustrates where a Property of
Object B follows any changes to the value of a Property of Object A.
An illustration of Ports.
<illustration here in original documentation>
There are three kinds of Ports:
InputPorts, OutputPorts and InputOutputPorts
They are all children of Port.
Each is “attached” to a specific Property of an Object, and the Ports are then“wired” together. (For
nomenclature, “attaching” connects a Port to a Property of an Object, “wiring” connects Ports together.)
When a Property of an Object changes, the OutputPort attached to it activates; which in turn, activates
the InputPort that it is wired to; which in turn, sets the value of the Property the InputPort is attached to.
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.
Page 548
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e n a b l e d o f P o r t
A port has a “signature” which specifies an object type to be used to restrict the set of other Ports that
this Port can be wired to. An error will be signaled if there is an attempt to wire an OutputPort to an
InputPort with a signature specifing a type that is not equal to or a subtype of the OutputPort's signature.
This is most useful for the autowire operation, where all you specify to Objects to wire together, and
wires will be connected between the two Objects wherever the signatures permit.
Ports can also filter the values they transmit and receive. For any Port, you can specify the “valueType”,
i.e. the type of the Object, or a list of types of Objects it will respond to.
Properties of Port
enabled of Port
Returns True if the Port is enabled or False if the Port is disabled.
Getter
get the enabled of me
Setter
set the enabled of me
to NewValue
feedbackaction of Port
Getter
get the feedBackAction of me
Setter
set the feedbackaction of me
to NewValue
portobject of Port
portObject returns the value of the portObject property of the Port, i.e. the Object that the
Port is attached to.
Setting the portObject has the effect of detaching the Port from whatever object the Port
was attached to and attaching it to the same property of the specified Object. (Note: an
error will occur in the case where the new Object does not have the same Property as the
Page 549
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p o r t p r o p e r t y o f P o r t
old Object; we don't want the opportunity to leave ports attached to things that don't
exist. Typically you would use the more explicit AttachPort handler to attach a Port to a
new object.)
Getter
get the portObject of me
Setter
set the portobject of me
to NewValue
me (a Port)
to
Example
get the portObject of Port
set the portObject of Port to object
set the portObject of Port218 to RoundRectangle-277
portproperty of Port
portProperty returns the Property of the Object that the Port is attached to.
Setting the portProperty of a Port has the effect of detaching the Port from whatever
property it was attached to and then attaching it to the specified property on the same
Object.
Note: See also:
portObject, detachPort, attachPort◆
Getter
get the portProperty of me
Setter
set the portproperty of me
to NewValue
Example
set the portProperty of Port218 to fillColor
get the portProperty of Port
set the portProperty of Port to object
Page 550
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s i g n a t u r e o f P o r t
signature of Port
Returns or sets the signature property of the Port.
Signatures are used to limit the selection of Ports that a Port can be wired to. Each Port has
a signature slot, by default set to True (no restrictions), and when two Ports are wired
together, their signatures are tested for compatibilty.
The signature can be of any of the following forms:
A single Object.
Specifies an Object. For an OutputPort to be wired to an InputPort the signature of the
InputPort Object must inherit from the signature of the OutputPort Object.
{and Object1 Object2...}
Specifies the intersection of a set of objects. An OutputPort signature of this form requires
that any InputPort wired to it have a signature that inherits from all of the Objects. An
InputPort with such a signature specifies that any OutputPort wired to it have a signature
that is an ancestor of all the Objects.
{or Object1 Object2...}
Specifies the union of a set of Objects. An OutputPort signature of this form requires that
any InputPort wired to it have a signature that inherits from (but not equal to) any of the
Objects. An InputPort with such a signature specifies that any OutputPort wired to it have
a signature that is an ancestor (but not equal to) any of the Objects.
{for Object1 Object2...}
Specifies the inclusive union of a set of Objects. An OutputPort signature of this form
requires that any InputPort wired to it have a signature that inherits from (or equal to) any
of the Objects. An InputPort with such a signature specifies that any OutputPort wired to
it have a signature that is an ancestor (or equal to) any of the Objects.
True
Specifies a wildcard. A Port with a signature of this form may be wired to any Port, except
those with a signature of False .
False
Matches nothing. This Port can't be wired to anything.
Wiring InputOutputPorts together requires that the signatures be compatible in both
directions.
In order to maintain consistency, the signature of a Port can only be set when it is not
wired to anything.
Note: See also:
autoWire, portsCompatible◆
Getter
get the signature of me
Page 551
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
v a l u e t y p e s o f P o r t
Setter
set the signature of me
to NewValue
Example
get the signature of Port
set the signature of Port to newSignature
valuetypes of Port
Getter
get the valueTypes of me
Setter
set the valuetypes of me
to NewValue
Handlers of Port
detachport of Port
detachPort me
Detaches the Port from whatever Object and property it is attached to, but leaves wiring
intact. (An error will occur if a detached InputPort gets active; perhaps this condition
should just silently happen?)
Note: See also:
attachPort◆
me (a Port)
Example
detach Port
disable of Port
disable me
Page 552
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d i s a b l e d o f P o r t
me (a Port)
Example
disable Port
disabled of Port
disabled me
when Port is disabled ...
Returns True if the Port is disabled, False if the Port is enabled.
Note: See also:
disable, enable, enabled◆
me (a Port)
enable of Port
enable me
Enables a disabled Port, undoing the work of the disable handler.
Note: See also:
disable, disabled, enabled◆
me (a Port)
Example
enable Port
portfilter of Port
portFilter me, value
Page 553
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p o r t t y p e o f P o r t
This is the handler that checks the valuetype spec of the Port to see if this value should
cause the port to activate (True = activate, False = don't activate). The user can write
their own portFilter handler to do their own filtering.
Note: See also:
activateOutputPort◆
me (a Port)
value
Example
portFilter Port, value
porttype of Port
portType me
returns the type of the Port; either :Input, :Output, :InputOutput, or :Unknown
me (a Port)
PositiveInteger
(a VirtualType)
See Also
NonNegativeInteger, VirtualType
Handlers of PositiveInteger
typeSatisfied of PositiveInteger
typesatisfied me, obj
Returns true if the given object is an integer greater than zero.
Page 554
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t y p e S a t i s fi e d o f P o s i t i v e I n t e g e r
me (a PositiveInteger)
object
PPCToolboxError
(a SystemError)
See Also
The Condition System section of the User Guide's SK8Script Language chapter
ProgrammaticError
(an Error)
See Also
The Condition System section of the User Guide's SK8Script Language chapter
project
(an Object)
In SK8, you organize all of your work into one or more projects. A project is the workspace for what will
eventually become the title, application or tool that you wish to build. Everything that you put into a
project will find its way to the delivered title or tool.
Projects are modules that can be organized into a hierarchy such that objects in one project can be
accessible in another project. SK8 itself is a project, whose object name is SK8, which contains the core
functionality of the SK8 system. All projects must therefore be directly or indirectly rooted in the SK8
project. A project that "uses" another project in this way is said to be a subproject of the other: conversely,
a project used by another project is said to be a superproject of the other. Subprojects of another project
are said to be peer projects. A project can have one and only one superproject (the default is, of course,
SK8 itself), but it can have as many subprojects as desired.
Page 555
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o n d i t i o n r e s p o n s e s o f P r o j e c t
Each project object, though it is stored along with all objects of a project into a project store file, is actually
created in the space of its superproject. This permits peer subprojects of another project to be able to
directly access each other's project objects. Therefore, although the objects in peer projects cannot access
each other, an API between these projects can be designed around the project objects themselves.
Note: You should never directly modify the Project object.◆
See Also
See also Library object
Properties of project
conditionresponses of Project
Getter
get the conditionResponses of me
Setter
set the conditionresponses of me
to NewValue
constants of Project
Getter
get the constants of me
with inherited
with private
Returns a list containing all of the constants in the project. Returns False if there are no
constants in the project. If inherited is True , then all constants accessible by the project are
included (the default is False ).
me (a Project)
[with inherited]
[with objectnames]
Page 556
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
F i l e o f P r o j e c t
Example
get the constants of Project with inherited
File of Project
Getter
get the File of me
Setter
set the file of me
to NewValue
filename of Project
Setter
set the filename of me
to NewValue
me (a Project)
to
functions of Project
Getter
get the functions of me
with private
Returns a list containing all of the function names (each represented by a symbol) for
functions in the project. Returns False if there are no functions in the project. If inherited
is True , then all functions accessible by the project are included (the default is False ).
me (a Project)
[with inherited]
[with name]
Example
get the functions of Project with inherited
Page 557
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
g l o b a l s o f P r o j e c t
globals of Project
Returns a list containing all of the globals in the project. Returns False if there are no
globals in the project. If inherited is True , then all globals accessible by the project are
included (the default is False ).
Getter
get the globals of me
with inherited
with private
Example
get the globals of SK8 with inherited
libraries of Project
Getter
get the libraries of me
Setter
set the libraries of me
to NewValue
menus of Project
Getter
get the menus of me
Returns a list containing all of the menu objects (descendants of Menu) in the project.
Returns False if the project has no menus.
me (a Project)
Example
get the menus of Project
Page 558
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o b j e c t N a m e o f P r o j e c t
objectName of Project
Setter
set the objectname of me
with force
to NewValue
me (a Project)
[with force]
to
objects of Project
Getter
get the objects of me
Returns a list containing all of the objects in the project, except for the project object itself.
Returns False if the project has no objects in it.
me (a Project)
Example
get the objects of Project
preferences of Project
Getter
get the preferences of me
Setter
set the preferences of me
to NewValue
Page 559
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e q u i r e d p r o j e c t o f P r o j e c t
requiredproject of Project
Getter
get the requiredProject of me
Setter
set the requiredproject of me
to NewValue
requiringprojects of Project
Getter
get the requiringProjects of me
Setter
set the requiringprojects of me
to NewValue
swapfile of Project
Getter
get the swapFile of me
Setter
set the swapfile of me
to NewValue
version of Project
Getter
get the version of me
Setter
set the version of me
to NewValue
Page 560
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w i n d o w s o f P r o j e c t
windows of Project
Getter
get the windows of me
Returns all of the actors in the project that are directly contained by the stage.
me (a Project)
Handlers of project
activate of Project
activate me
System event delegated by toplevel actors of project when the toplevel actor does not
handle the activate event. Check the EventActor global to see which actor was the original
target of the activate event. (See activate event for Actor.)
The deactivate handler will get called to set the framecolor to Black when the window
deactivates.
me (a Project)
addconstantdialog of Project
addConstantDialog me
bring up a dialog for adding a constant to the given project
me (a Project)
addfunctiondialog of Project
addFunctionDialog me
Display the Add Function Dialog Box for the given project
me (a Project)
Page 561
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a d d v a r i a b l e d i a l o g o f P r o j e c t
addvariabledialog of Project
addVariableDialog me
display the dialog box for adding a variable to the given project
me (a Project)
compactproject of Project
compactProject me
with filename
with maxversions
with media
Compacts project store file.
me (a Project)
[with filename]
[with maxversions]
[with media]
deactivate of Project
deactivate me
System event delegated by toplevel actors of project when the toplevel actor does not
handle the deactivate event. Check the EventActor global to see which actor was the
original target of the deactivate event. (See deactivate event for Actor.)
me (a Project)
Example
deactivate Project
dismisshandlereditors of Project
dismissHandlerEditors me
with saving
with dialog
close all the Projects Hanlder Editors
Page 562
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 P r o j e c t
me (a Project)
[with saving]
[with dialog]
localVirtualProperties of Project
localVirtualProperties me
me (a Project)
menubars of Project
menubars me
Returns a list containing all of the menubar objects (descendants of Menubar) in the
project. Returns False if the project has no menubars.
me (a Project)
Example
get the menubars of Project
menuitems of Project
menuItems me
Return all known descendents of MenuItem in the project
me (a Project)
opened of Project
opened me
opened is an event that is sent to a project after the store has successfully loaded the
project. opened should be used to perform any special project initialization based on the
current environment or chronological time.
me (a Project)
Page 563
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p r e s e r v e o f P r o j e c t
preserve of Project
preserve me
System event. Called when the object must be saved from its memory format to its disk
format when SK8's image is saved. This is internally used for SK8 objects during SK8
image save time.
me (a Project)
Example
preserve Project
publishSymbol of Project
publishSymbol me, sym
Permits you to explicitly publish a symbol to your subprojects.
me (a Project)
sym
removeConstant of Project
removeConstant me
with name
with store
Removes the constant from Project with the given name. Name must be the symbol
representing the constant.
me (a Project)
[with name]
[with store]
Example
removeConstant of Project with name
removeFunction of Project
removeFunction me
with name
Page 564
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e m o v e Va r i a b l e o f P r o j e c t
Removes the function name (a Symbol) from the project in which it exists. If inproject (a
project object) is provided, then the function will be removed only if it belongs to that
project.
me (a Project)
[with name]
Example
removeFunction name with inproject
removeVariable of Project
removeVariable me
with name
with store
Removes the variable from Project with the given name. Name must be the symbol
representing the variable.
me (a Project)
[with name]
[with store]
Example
removeVariable of Project with name
requiredProjects of Project
requiredProjects me
Returns a list containing all of the projects required by project. This list includes the
directly required project, and all projects required by it, and so on. Every project must
require at least one other project: usually the SK8 project itself. Only the SK8 project does
not require any other projects.
me (a Project)
Example
get the requiredProjects of Project
Page 565
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e s t o r e o f P r o j e c t
restore of Project
restore me
System event. Called when the object must be restored from its disk format to its memory
format when SK8 loads. This is internally used for SK8 objects during SK8 load time.
me (a Project)
Example
restore Project
saveproject of Project
saveProject me
Saves project to a file.
me (a Project)
saveprojectas of Project
saveProjectAs me, fileobj
me (a Project)
fileobj
writesources of Project
writeSources me, afilename
Allows you to write the sources of a project as text into a text file.
Note: In SK8 1.0a2, only the functions and handlers of the project can be written out.◆
me (a Project)
[with filename]
[with objects]
[with handlers]
[with functions]
[with globals]
Page 566
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c r e a t e s e c o n d i t e m o f
P r o j e c t D a t a S h e e t P i c k e r
ProjectDataPicker
(a StyledPicker, MixinForProjectDataPickers)
ProjectDataSheet
(a TextList)
Example
set the inputProject of the Picker of SuperCoolProjectDataSheet to SK8
ProjectDataSheetPicker
(a TwoByNBrowserPicker, MixinForProjectDataPickers)
Handlers of ProjectDataSheetPicker
createseconditem of ProjectDataSheetPicker
createSeconditem me, theitem
If it is a function, show its arguments. If it is a constant or variable it returns its value.
Page 567
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e d i t p a r e n t o f P r o p e r t y C o n t r o l P a n e l
me (a ProjectDataSheetPicker)
theitem
See Also
TwoByNBrowserPicker
ProjectImproperlyClosedError
(a FileError)
See Also
The Condition System section of the User Guide's SK8Script Language chapter
PropertyControlPanel
(a BrowserPaper)
This is a component for editing various aspects of a property, such as inheritance. It has an
inputObject and an InputProperty properties. Note that if InputObject is set to a list, the first
item is selected. The user can use it to set the property's value, whether or not it inherits, etc. It can also
make the property reinherit it's value from its parent. It can make all of the descendants of the object
reinherit the value.
Properties of PropertyControlPanel
editparent of PropertyControlPanel
This tags the button which will set the inputobject of the panel to the parent from which
this property is being inherited (if any).
Page 568
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
g e t t e r b u t t o n o f P r o p e r t y C o n t r o l P a n e l
Getter
get the editParent of me
Setter
set the editparent of me
to NewValue
getterbutton of PropertyControlPanel
This tags the button which will bring up a Script Editor to view the getter of the property.
Getter
get the getterButton of me
Setter
set the getterbutton of me
to NewValue
inheritablecheck of PropertyControlPanel
This tags the checkbox which specifies and controls whether or not the property is
dynamically inherited.
Getter
get the inheritableCheck of me
Setter
set the inheritablecheck of me
to NewValue
inputobject of PropertyControlPanel
This specifies the object which is being edited. Note this component cannot handle more
than one object at a time. Therefore this property will not accept a collection as a value.
Getter
get the inputObject of me
Page 569
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n p u t p r o p e r t y o f P r o p e r t y C o n t r o l P a n e l
Setter
set the inputobject of me
to NewValue
me (a PropertyControlPanel)
to
inputproperty of PropertyControlPanel
This specifies the property which is being edited.
Getter
get the inputProperty of me
Setter
set the inputproperty of me
to NewValue
me (a PropertyControlPanel)
to
privatecheck of PropertyControlPanel
This tags the checkbox which specifies and controls whether or not the property is private.
Getter
get the privateCheck of me
Setter
set the privatecheck of me
to NewValue
propagatebutton of PropertyControlPanel
This button propagates the value of the property to all known descendants.
Getter
get the propagateButton of me
Page 570
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e i n h e r i t b u t t o n o f P r o p e r t y C o n t r o l P a n e l
Setter
set the propagatebutton of me
to NewValue
reinheritbutton of PropertyControlPanel
This tags the button which will force a property to reinherit its value from it's parent.
Getter
get the reinheritButton of me
Setter
set the reinheritbutton of me
to NewValue
setterbutton of PropertyControlPanel
This tags the button which will bring up a Script Editor to view the setter of the property.
Getter
get the setterButton of me
Setter
set the setterbutton of me
to NewValue
ValueText of PropertyControlPanel
This tags the valueText which specifies and controls the value of the property.
Getter
get the ValueText of me
Setter
set the valuetext of me
to NewValue
Page 571
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e s i z e d o f P r o p e r t y C o n t r o l P a n e l
Handlers of PropertyControlPanel
resized of PropertyControlPanel
resized me
This makes sure all of the contents are resized nicely.
me (a PropertyControlPanel)
PropertyDataRect
(a Rectangle)
This rectangle along with the ObjectDataRect and the HandlerDataRect are the objects used to
provide drag and drop functionality between the various components. This one provides a place to drag
a single property which has been defined on one or more objects.
Properties of PropertyDataRect
componentfrom of PropertyDataRect
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
Page 572
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o b j e c t s o f P r o p e r t y D a t a R e c t
See Also
value
objects of PropertyDataRect
This property specifies the object or set of objects whose property is being dragged.
Getter
get the objects of me
Setter
set the objects of me
to NewValue
propertyname of PropertyDataRect
This property specifies the name of the property being dragged.
Getter
get the propertyName of me
Setter
set the propertyname of me
to NewValue
Handlers of PropertyDataRect
value of PropertyDataRect
value me
This returns the value of the property being dragged. If there is more than one object
specified, then either the value is returned if they all share that value or "Different Values"
is returned if they do not share the same value.
me (a PropertyDataRect)
Page 573
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
v a l u e o f P r o p e r t y D a t a R e c t
PropertyHandlerList
(a TextList)
Example
set the inputObjects of the Picker of SuperCoolPropertyHandlerList to
{rectangle, oval, roundrect}
PropertyHandlerPicker
(a StyledPicker, MixinForPropertyHandlerPickers)
PropertyHandlerSheet
(a TextList)
Example
set the inputObjects of the Picker of SuperCoolPropertyHandlerSheet to
{rectangle, oval, roundrect}
Page 574
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
v a l u e o f P r o p e r t y D a t a R e c t
PropertyHandlerSheetPicker
(a TwoByNBrowserPicker, MixinForPropertyHandlerPickers)
PropertyList
(a TextList)
This is a TextList whose PickerPrototype has been set to PropertyPicker. 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 SuperCoolPropertyList to {rectangle,
oval, roundrect}
PropertyPicker
(a PropertyHandlerPicker)
PropertySheet
(a TextList)
Page 575
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o w n e r o b j e c t o f P r o p e r t y Ty p e M i s m a t c h E r r o r
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 SuperCoolPropertySheet to {rectangle,
oval, roundrect}
PropertySheetPicker
(a PropertyHandlerSheetPicker)
PropertyTypeMismatchError
(a TypeMismatchError)
Properties of PropertyTypeMismatchError
ownerobject of PropertyTypeMismatchError
Getter
get the ownerObject of me
Setter
set the ownerobject of me
to NewValue
propertyname of PropertyTypeMismatchError
Getter
get the propertyName of me
Page 576
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w r i t e o b j e c t o f P r o p e r t y Ty p e M i s m a t c h E r r o r
Setter
set the propertyname of me
to NewValue
Handlers of PropertyTypeMismatchError
writeobject of PropertyTypeMismatchError
writeObject me, thestream, rereadably
me (a PropertyTypeMismatchError)
thestream
rereadably
Proxy
(an Object)
Proxies are objects that stand in for other objects. By default all events sent to the Proxy get forwarded to
the original object. Customizable behavior can be implemented by adding new handlers to Proxies, or by
adding handlers that shadow handlers of the original object. A typical application would be where one
wants to display an abbreviated version of an object, or display an object in a completely different way in
a separate context.
A Proxy has one property, originalObject, the object that the Proxy is standing in for.
Any number of Proxies may be created to stand in for an object.
Proxies may stand in for other Proxies.
Note: This implementation runs on a simple rule: an event is passed on to the original object only when
the event is not handled by the Proxy. This might cause some confusion in the case where a handler
exists for the original object, and a before handler with the same name is added to the Proxy. The original
handler will not be run as the before handler will take it's place. For this situation, if you wanted to have
the before handler run before the original object handler, you would need to add a primary handler to
the proxy that simply called the handler on the Proxy's original object.◆
Example
Page 577
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o r i g i n a l o b j e c t o f P r o x y
Example:
Dino is a separate object than Fred, but acts just like Fred. So, if we ask
Dino what he had for dinner, the response is whatever Fred had.
new object with objectname "Flintstone" with properties {'dinner'}
new Flintstone with objectName "Fred"
proxy Fred with objectName "Dino"
set Fred's dinner to "BrontoBurgers"
get Dino's dinner
Properties of Proxy
originalobject of Proxy
The object that the Proxy is standing in for.
Getter
get the originalObject of me
Setter
set the originalobject of me
to NewValue
QDPicture
(a Media)
Parent object of QuickDraw Picture resources. QDPictures can be displayed by making them the media
of an imageRenderer.
See Also
ImageRenderer.
Page 578
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b o u n d s r e c t o f Q D P i c t u r e
Handlers of QDPicture
boundsrect of QDPicture
boundsRect me
Returns the physical rectangle that encloses the image stored in this media object.
me (a QDPicture)
defaultrenderstyle of QDPicture
defaultRenderStyle me
Returns the way in which a media of this type is commonly rendered. For the QDPicture,
this handler returns 'renderStretched' .
me (a QDPicture)
displaysample of QDPicture
displaysample me, theactor
Calls showMediaInActor to display the QDPicture in the actor.
me (a QDPicture)
theActor (an Actor)
See Also
loadMedia of QDPicture
loadMedia me
If the QDPicture has no resourceId , it means that it lives in the data fork of a file, and
this handler actually reads in the picture from it. Its file property is expected to point to
the file that contains the data.
me (a QDPicture)
Page 579
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e n d e r s t r e t c h e d o f Q D P i c t u r e
See Also
renderstretched of QDPicture
renderStretched me, therenderer, theactor, region, thepaper
Renders the image in the QDPicture stretching it to fill the region to be rendered.
rendertiled of QDPicture
renderTiled me, therenderer, theactor, region, thepaper
Renders the image stored in the QDPicture tiling it to fill the region to be painted.
me (a QDPicture)
therenderer (an ImageRenderer): The renderer whose media is this
QDPicture.
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 QDPicture
renderUnstretched me, therenderer, theactor, region, thepaper
Renders the image stored in the QDPicture 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 (a QDPicture)
therenderer (an ImageRenderer): The renderer whose media is this
QDPicture.
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 QDPicture
size me
Page 580
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h i s t o r y m e n u o f Q u e r y F i e l d
Returns the size in pixels of the image stored by this media object.
me (a QDPicture)
QDPictureToPictTranslator
(a Translator)
Knows how to turn a QDPicture object into a "PICT" handle and viceversa.
Handlers of QDPictureToPictTranslator
QueryField
(a Rectangle, BrowserComponent)
Properties of QueryField
historymenu of QueryField
This is the history menu which stores the queries.
Getter
get the historyMenu of me
Page 581
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n p u t s t r i n g o f Q u e r y F i e l d
Setter
set the historymenu of me
to NewValue
inputstring of QueryField
The value of this property, which should be a string, is put in the textfield and evaluated
when set.
Getter
get the inputString of me
Setter
set the inputstring of me
to NewValue
me (a QueryField)
to
outputobjects of QueryField
When the textfield is evaluated, the result is put into this property.
Getter
get the outputObjects of me
Setter
set the outputobjects of me
to NewValue
textField of QueryField
This is the scriptEditText of the queryfield.
Getter
get the TextField of me
Setter
set the textfield of me
to NewValue
Page 582
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d o b o o k k e e p i n g o f Q u e r y F i e l d
Handlers of QueryField
dobookkeeping of QueryField
doBookKeeping me
with warnings
with history
Add the text from the textfield to the historymenu
me (a QueryField)
[with warnings]
[with history]
evaluate of QueryField
evaluate me
Evaluate the textFeild of me (a QueryField) and put the results in my outputObjects .
me (a QueryField)
resized of QueryField
resized me
The resized event is sent each time an actor's boundsRect is set with the justMoving flags
set to False (the default).
me (a QueryField)
QuickTimeCallBack
(an Object)
A QuickTimeTimeBase can have any number of QuickTimeCallBack objects associated with it.
Each one specifies criteria which when met will cause its callBackEvent handler to be called. For
example, a child of QuickTimeCallBackAtTime can specify that its callBackEvent handler should
be called when its timebase's timeValue reaches a certain value.
Page 583
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a c t i v e o f Q u i c k Ti m e C a l l B a c k
QuickTimeCallBackAtRate
QuickTimeCallBackAtTimeJump
QuickTimeCallBackAtExtremes
Whereas in C you would call CallMeWhen to schedule a callback event and specify its parameters, in
SK8 you simply set the elements of the parameters of the child of one of the QuickTimeCallBack
children mentioned above.
See Also
QuickTimeCallBackAtTime , QuickTimeCallBackAtRate , QuickTimeCallBackAtTimeJump ,
QuickTimeCallBackAtExtremes , QuickTimeTimeBase
Properties of QuickTimeCallBack
active of QuickTimeCallBack
Type: a Boolean
True means the callback is ready to call callBackEvent of me when the criteria are
met.
Getter
get the active of me
me (a QuickTimeCallBack)
Page 584
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p a r a m e t e r s o f Q u i c k Ti m e C a l l B a c k
Setter
set the active of me
with force
to NewValue
When you change the value from False to True , the callback is activated with the
present values in parameters .
When you change the value from True to False , the callback is canceled
When set to True , calls T_CallMeWhen, IM-QuickTime, p. 2-337, with the contents of
the parameters of me as the param1, param2, and param3 arguments.
me (a QuickTimeCallBack)
[with force] (a Boolean): You shouldn't need this, but if this argument is
True the setter will do its job regardless of the previous value of the
property. Normally, if you set active to the value it already has,
nothing happens.
to
parameters of QuickTimeCallBack
A list of 3 values. How these values are interpreted depends on the value of type .
The type and the parameters together determine the criteria under which
callBackEvent is called.
Getter
get the parameters of me
me (a QuickTimeCallBack)
Setter
set the parameters of me
with reactivate
to NewValue
If reactivate is True , sets active to False , then back to True again with the new
paramters .
Page 585
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e p e a t i n g o f Q u i c k Ti m e C a l l B a c k
me (a QuickTimeCallBack)
[with reactivate] (defaulting to True)
to
See Also
repeating of QuickTimeCallBack
Type: a Boolean
True means that after callBackEvent is called, active will be True again.
Getter
get the repeating of me
me (a QuickTimeCallBack)
Setter
set the repeating of me
to NewValue
me (a QuickTimeCallBack)
to
timebase of QuickTimeCallBack
Type: QuickTimeTimeBase
The QuickTimeTimeBase the QuickTimeCallBack belongs to.
Getter
get the timebase of me
me (a QuickTimeCallBack)
Setter
set the timebase of me
to NewValue
Page 586
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t y p e o f Q u i c k Ti m e C a l l B a c k
See Also
QuickTimeTimeBase
type of QuickTimeCallBack
Type: One of: False, 'Time', 'Rate', 'TimeJump', 'Extremes'
The type of QuickTimeCallBack itself is always False.
The type of every descendant of QuickTimeCallBack is always one of the
abovementioned symbols.
The value of this property is used to determine the type argument passed to the
QuickTime NewCallBack function.
Getter
get the type of me
me (a QuickTimeCallBack)
Setter
set the type of me
to NewValue
Handlers of QuickTimeCallBack
callBackEvent of QuickTimeCallBack
callBackEvent me, count
You supply your own callBackEvent code to do what you want when the callback
criteria are met. You don't have to do inherited .
When the desired callback situation occurs, here's what happens:
Page 587
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d i s p o s e o f Q u i c k Ti m e C a l l B a c k
me (a QuickTimeCallBack)
dispose of QuickTimeCallBack
dispose me
The dispose handler sets active of me to False and disposes the low-level CallBack
object, which renders this QuickTimeCallBack object useless. The object is also
removed from the callbacks of my timeBase . A QuickTimeCallBack object can't
be garbage collected until either it is disposed or its timeBase is collectable.
When a QuickTimeCallBack is garbage collected, its low-level object is canceled and
disposed.
me (a QuickTimeCallBack)
QuickTimeCallBackAtExtremes
(a QuickTimeCallBack)
A child of QuickTimeCallBack .
When the timeValue of my timeBase satisfies the conditions in my parameters , the
callBackEvent handler is called.
See Also
QuickTimeCallBack , parameters of QuickTimeCallBackAtExtremes
Properties of QuickTimeCallBackAtExtremes
parameters of QuickTimeCallBackAtExtremes
A list of 3 values.
Initially, { { 'start', 'stop' }, 0, 0 }
The first item of parameters must be one of these:
Page 588
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p a r a m e t e r s o f
Q u i c k Ti m e C a l l B a c k A t E x t r e m e s
'start'
'stop'
{ 'start', 'stop' }
The second item of parameters and the third item of parameters are ignored but
must be 0.
For more detail, see IM-QuickTime, p. 2-336. But take note, it isn't clear about the fact that
you declare in the first item of parameters whether you want the callback at the start and/
or stop point, and it implies that the callback is automatically rescheduled, but it isn't
unless repeating of me is True .
Setter
set the parameters of me
with reactivate
to NewValue
me (a QuickTimeCallBackAtExtremes)
[with reactivate] (defaulting to True)
to
See Also
parameters of QuickTimeCallBack
QuickTimeCallBackAtRate
(a QuickTimeCallBack)
A child of QuickTimeCallBack .
When the rate of my timeBase satisfies the conditions in my parameters , the callBackEvent
handler is called.
See IM-QuickTime, p. 2-336 and 2-338.
See Also
parameters of QuickTimeCallBackAtRate , parameters of QuickTimeCallBackAtRate
Page 589
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p a r a m e t e r s o f Q u i c k Ti m e C a l l B a c k A t R a t e
Properties of QuickTimeCallBackAtRate
parameters of QuickTimeCallBackAtRate
A list of 3 values.
Initially, { 'greaterThan', 1, 0 }
The first item of parameters must be one of these:
'change'
'lessThan'
'greaterThan'
'equal'
'lessEqual'
'greaterEqual'
'notEqual'
The second item of parameters is the rate at which the callback is to be invoked.
The third item of parameters is ignored and must be 0.
For more detail, see IM-QuickTime, p. 2-338.
Setter
set the parameters of me
with reactivate
to NewValue
me (a QuickTimeCallBackAtRate)
[with reactivate] (defaulting to True)
to
See Also
parameters of QuickTimeCallBack
QuickTimeCallBackAtTime
(a QuickTimeCallBack)
A child of QuickTimeCallBack .
Page 590
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p a r a m e t e r s o f Q u i c k Ti m e C a l l B a c k A t Ti m e
See Also
QuickTimeCallBack , parameters of QuickTimeCallBackAtTime
Properties of QuickTimeCallBackAtTime
parameters of QuickTimeCallBackAtTime
A list of 3 values.
Initially, { 'either', 0, 1 }
The first item of parameters must be one of these:
'forward'
'backward'
'either'
The second item of parameters is the timeValue at which the callback is to be invoked.
The third item of parameters contains the timeScale in which to interpret the time
value that is in the second item of parameters .
A value of 0 means to use the TimeBase's native timeScale.
For more detail, see IM-QuickTime, p. 2-338.
Setter
set the parameters of me
with reactivate
to NewValue
me (a QuickTimeCallBackAtTime)
[with reactivate] (defaulting to True)
to
See Also
parameters of QuickTimeCallBack
Page 591
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c a l l B a c k E v e n t o f Q u i c k Ti m e C a l l B a c k F o r R e n d e r e r
QuickTimeCallBackAtTimeJump
(a QuickTimeCallBack)
When the timeValue of my timeBase jumps, the callBackEvent handler is called. The
parameters property is ignored.
See Also
QuickTimeCallBack
Properties of QuickTimeCallBackAtTimeJump
QuickTimeCallBackForRenderer
(a QuickTimeCallBackAtExtremes)
A child of QuickTimeCallBackAtExtremes .
This object is used by QuickTimeRenderer to implement its done handler. It is not intended for use by
SK8 programmers.
See Also
QuickTimeCallBackAtExtremes
Handlers of QuickTimeCallBackForRenderer
callBackEvent of QuickTimeCallBackForRenderer
callBackEvent me, count
Calls the done handler of your child of QuickTimeRenderer.
me (a QuickTimeCallBackForRenderer)
Page 592
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i s Vi s u a l o f Q u i c k Ti m e M e d i a
QuickTimeMedia
(an Object)
See Also
QuickTimeTrack , QuickTimeMovie
Properties of QuickTimeMedia
isVisual of QuickTimeMedia
Type: a Boolean
True if the track's media is something to show on the screen.
Getter
get the isVisual of me
me (a QuickTimeRenderer)
Setter
set the isvisual of me
to NewValue
See Also
enabled of QuickTimeTrack
movie of QuickTimeMedia
Type: QuickTimeMovie
The QuickTimeMovie object that owns this track.
Page 593
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t r a c k o f Q u i c k Ti m e M e d i a
Getter
get the movie of me
me (a QuickTimeRenderer)
Setter
set the movie of me
to NewValue
track of QuickTimeMedia
Type: QuickTimeTrack
The QuickTimeTrack object that owns this QuickTimeMedia object.
Getter
get the track of me
me (a QuickTimeRenderer)
Setter
set the track of me
to NewValue
See Also
QuickTimeTrack
QuickTimeMovie
(a Media)
A QuickTimeMovie object represents a native QuickTime Movie object as a SK8 object. It can be created
in various ways: from the clipboard, from a handle, from a resource, from a resource in a file, from a
data-fork-only file. It represents only the movie data itself. To play a QuickTimeMovie , you must
create a QuickTimeRenderer and set its media property to the QuickTimeMovie .
In native QuickTime, a Movie object serves both as the representation of the movie's attributes and as the
player (or renderer, using SK8 terminology). SK8 differs from native QuickTime in that it has two
separate objects for these two. In addition to the QuickTimeMovie object, there is a
QuickTimeRenderer ) object for rendering (i.e. playing) movies. QuickTimeMovie has virtual
Page 594
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t r a c k o f Q u i c k Ti m e M e d i a
properties and handlers for the more static attributes of the movie, including everything about a movie
that is saved in a file. QuickTimeRenderer has virtual properties and handlers to cover playing a
movie or rendering it visually.
Each of the different ways you can create a QuickTimeMovie has a different set of optional arguments
you may use when calling new.
Here they are:
Create a new QuickTimeMovie Object referencing an existing movie file. The file is searched for any
resource which can be opened as a QuickTime movie. First "MooV" resources are searched for, then
others, including "AIFF". When an openable type is found, the resource of that type with the lowest ID is
used, and the new QuickTimeMovie 's resourceID property is set to the ID. Otherwise, if no usable
resources are found in the file and a movie is found at the beginning of the file's Data Fork, the new
QuickTimeMovie 's fileOffset property is set to 0. See NewMovieFromFile in Inside Macintosh
QuickTime™ p. 2-88.
new QuickTimeMovie with file foo
Valid option arguments are:
with active
with dontResolveDataReferences
with dontAskUnresolvedDataReferences
with dontAutoAlternate
Create a new QuickTimeMovie Object referencing an existing movie file. If the file is searched for any
resource which can be opened as a QuickTime movie. First "MooV" resources are searched for, then
others, including "AIFF". When an openable type is found, the resource of that type with the lowest ID is
used, and the new QuickTimeMovie 's resourceID property is set to the ID. However, if the
resourceID or resourceName optional argument is specified, then a resource so identified is searched
for. See NewMovieFromFile in Inside Macintosh QuickTime™ p. 2-88.
new QuickTimeMovie with resourceFile foo
Valid option arguments are:
with resourceID (a NonNegativeInteger defaulting to 0)
-- 0 means use the lowest-numbered
-- "MooV" resource ID found in the file (or other openable type)
with resourceName (a String defaulting to false)
-- false means it doesn't matter what
-- the resource name is
with active
with dontResolveDataReferences
with dontAskUnresolvedDataReferences
with dontAutoAlternate
Create a new QuickTimeMovie Object referencing an existing file with the movie data stored in the data
fork. This form is especially useful if the movie is not a the beginning of the Data Fork. See
NewMovieFromDataFork in Inside Macintosh QuickTime p. 2-109.
new QuickTimeMovie with dataFile foo
Valid option arguments are:
Page 595
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t r a c k o f Q u i c k Ti m e M e d i a
Page 596
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a c t i v e o f Q u i c k Ti m e M o v i e
See Also
QuickTimeRenderer, Media
Properties of QuickTimeMovie
active of QuickTimeMovie
Type: a Boolean
IM-QuickTime p. 2-146 says:
The Movie Toolbox services only active movies. When you deactivate a movie, the Movie
Toolbox may release system resources required by the movie, such as sound hardware,
open files, and allocated memory. Unless you set the newMovieActive flag when creating
a movie, you should call SetMovieActive before playing a movie.
Getter
get the active of me
Calls T_GetMovieActive and returns its result as a SK8 Boolean. See IM-QuickTime p.
2-146.
me (a QuickTimeMovie)
Setter
set the active of me
with dontforwardtorenderer
to NewValue
me (a QuickTimeMovie)
[with dontForwardToRenderer] (a Boolean): If my renderer is not False ,
a call to this setter causes a call to set active of my renderer,
which in turn may call set active of its media (me ) in addition
to taking other action. This argument is used in that case to prevent
infinite recursion. You will probably never need it.
to
Page 597
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a c t i v e S e g m e n t o f Q u i c k Ti m e M o v i e
activeSegment of QuickTimeMovie
Type: { startTime (a NonNegativeInteger), duration (a
NonNegativeInteger) }
Getter
get the activeSegment of me
me (a QuickTimeMovie)
Setter
set the activesegment of me
to NewValue
me (a QuickTimeMovie)
to: {} or False means the entire movie.{s, d} is interpreted thus: starting
time s, duration d{ s } is interpreted thus: if preferredRate is positive,
starting timeValue s through the end of the movie. If preferredRate is
negative, starting timeValue 0 through timeValue s.{False, d} is
interpreted thus: if preferredRate is positive, then {my
timeValue, d} . If preferredRate is negative, then {my
timeValue - d, -d} .
couldNotResolveDataReference of QuickTimeMovie
Type: a Boolean
This property is set when the QuickTimeMovie object is created. It represents one of the
return values from the underlying QuickTime call that created the movie.
Page 598
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c r e a t i o n t i m e o f Q u i c k Ti m e M o v i e
Getter
get the couldNotResolveDataReference of me
me (a QuickTimeMovie)
Setter
set the couldnotresolvedatareference of me
to NewValue
creationtime of QuickTimeMovie
Type: a DateTimeIndirect
The time the movie was created.
See IM-QuickTime, p. 2-220.
Getter
get the creationtime of me
me (a QuickTimeMovie)
Setter
set the creationtime of me
to NewValue
See Also
modificationTime of QuickTimeMovie
dataReferenceWasChanged of QuickTimeMovie
Type: a Boolean
This property is set when a QuickTimeMovie is created.
IM-QuickTime p. 2-88 says:
Page 599
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d a t a S i z e o f Q u i c k Ti m e M o v i e
The Movie Toolbox sets this boolean to True if it had to change any data references while
resolving them.
Getter
get the dataReferenceWasChanged of me
me (a QuickTimeMovie)
Setter
set the datareferencewaschanged of me
to NewValue
dataSize of QuickTimeMovie
Type: a NonNegativeInteger
The size, in bytes, of the movie's sample data that lies in the specified segment.
GetMovieDataSize counts each use of a sample. That is, if a movie uses a given sample
more than once, the size of that sample is included in the returned size value one time for
each use. Consequently, the returned size is greater than or equal to the actual size of the
movie's sample data, and corresponds to the amount of movie data that will be retrieved
when you call the FlattenMovie function or FlattenMovieData function (described on page
2-105 and page 2-107, respectively).
Getter
get the dataSize of me
with segment
me (a QuickTimeMovie)
[with segment]: accepts same values as activeSegment .Default (False )
refers to the entire movie.
duration of QuickTimeMovie
Type: a NonNegativeInteger.
represents the timeValue of the end of the movie.
Getter
get the duration of me
Page 600
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
fi l e o f Q u i c k Ti m e M o v i e
me (a QuickTimeMovie)
file of QuickTimeMovie
Type: a File
Type: False
This property is set when the QuickTimeMovie was created.
The File object the QuickTimeMovie came from. It is intended that this be set when
the object is created and not modified after that.
Setter
set the file of me
to NewValue
fileOffset of QuickTimeMovie
Type: a NonNegativeInteger
Type: False
This property is set when the QuickTimeMovie was created.
The offset in the file's data fork if the movie came from a data-fork file, else False .
Getter
get the fileOffset of me
me (a QuickTimeMovie)
Setter
set the fileoffset of me
to NewValue
height of QuickTimeMovie
Type: a NonNegativeInteger
The height in pixels of the current size of the movie.
Page 601
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a t r i x o f Q u i c k Ti m e M o v i e
Getter
get the height of me
me (a QuickTimeMovie)
See Also
width of QuickTimeMovie
matrix of QuickTimeMovie
Type: an Array {3, 3} of Numbers
Getter
get the matrix of me
me (a QuickTimeMovie)
Setter
set the matrix of me
with dontforwardtorenderer
to NewValue
me (a QuickTimeMovie)
[with dontForwardToRenderer] (a Boolean): If my renderer is not False ,
a call to this setter causes a call to set matrix of my renderer,
which in turn may call set matrix of its media (me ) in addition
to taking other action. This argument is used in that case to prevent
infinite recursion. You will probably never need it.
to
modificationTime of QuickTimeMovie
Type: a DateTimeIndirect
The last time the movie was modified.
See IM-QuickTime, p. 2-220.
Page 602
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o v i e B o x o f Q u i c k Ti m e M o v i e
Getter
get the modificationtime of me
me (a QuickTimeMovie)
Setter
set the modificationtime of me
to NewValue
See Also
creationTime of QuickTimeMovie
movieBox of QuickTimeMovie
Type: { { left (a NonNegativeInteger), top (a NonNegativeInteger),
right (a NonNegativeInteger), bottom (a NonNegativeInteger)} }
Getter
get the movieBox of me
me (a QuickTimeMovie)
Setter
set the moviebox of me
with dontforwardtorenderer
to NewValue
me (a QuickTimeMovie)
[with dontForwardToRenderer] (a Boolean): If my renderer is not False ,
a call to this setter causes a call to set movieBox of my renderer,
which in turn may call set movieBox of its media (me ) in
addition to taking other action. This argument is used in that case to
prevent infinite recursion. You will probably never need it.
to: The numbers in the given list are rounded if they are not integers.If any
element of the list is False , that element of the movie's bounding box is
left as it was.Calls T_SetMovieBoxGC, IM-QuickTime p. 2-161.
Page 603
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o v i e N u m b e r o f Q u i c k Ti m e M o v i e
movieNumber of QuickTimeMovie
Type: one of { a NonNegativeInteger, False }
If the movie came from a data fork, then this number represents which movie from the
data fork. 0 is the first movie, 1 the second, etc.
Currently, movieNumber can only be 0.
Getter
get the movieNumber of me
me (a QuickTimeMovie)
Setter
set the movienumber of me
to NewValue
posterTime of QuickTimeMovie
Type: a NonNegativeInteger
The posterTime property represents the poster time for the movie. Since a movie poster
is a still frame, it is defined by a point in time within the movie. The poster's time is
expressed in the movie's time coordinate system. (Adapted from IM-QuickTime, p. 119.)
Getter
get the posterTime of me
me (a QuickTimeMovie)
Setter
set the postertime of me
with dontforwardtorenderer
to NewValue
me (a QuickTimeMovie)
[with dontForwardToRenderer] (a Boolean): If my renderer is not False ,
a call to this setter causes a call to set posterTime of my
renderer, which in turn calls set posterTime of its media (me )
in addition to taking other action. This argument is used in that case to
prevent infinite recursion. You will probably never need it.
to
Page 604
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p r e f e r r e d A s p e c t R a t i o o f Q u i c k Ti m e M o v i e
preferredAspectRatio of QuickTimeMovie
Type: a NonNegativeNumber
The width divided by the height (or 0, if height is 0)
of my preferredSize .
Getter
get the preferredAspectRatio of me
me (a QuickTimeMovie)
See Also
preferredAspectRatio of QuickTimeRenderer
preferredRate of QuickTimeMovie
Type: a Number
0 means the movie is stopped, 1 means normal speed, .5 means half speed, 2 means
double-speed, -1 means reverse normal speed, etc.
This is the rate at which the movie will play the next time you issue a start or play
command.
Getter
get the preferredRate of me
me (a QuickTimeMovie)
Setter
set the preferredrate of me
to NewValue
me (a QuickTimeMovie)
to
Page 605
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p r e f e r r e d S c a l e o f Q u i c k Ti m e M o v i e
preferredScale of QuickTimeMovie
Type: { horizontalScale (a Number), verticalScale (a Number) }
The scale of the movie when first created. If the movie is saved, this is the scale that will
be saved with it.
The movie's preferredSize is calculated at the preferredScale .
Getter
get the preferredScale of me
me (a QuickTimeMovie)
Setter
set the preferredscale of me
to NewValue
me (a QuickTimeMovie)
to
See Also
preferredSize
preferredSize of QuickTimeMovie
Type: { width (a NonNegativeInteger), height (a NonNegativeInteger)
}
The size of the movie given the currently enabled tracks, using the movie's
preferredScale .
Getter
get the preferredSize of me
me (a QuickTimeMovie)
Setter
set the preferredsize of me
to NewValue
Page 606
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p r e f e r r e d Vo l u m e o f Q u i c k Ti m e M o v i e
preferredVolume of QuickTimeMovie
Type: a Number
1 means full volume. .5 means half volume. Anything higher than 1 amplifies the sound
louder (which might cause clipping distortion). Anything 0 or less means no sound.
When the QuickTimeMovie is first created, this value reflects what was saved in the file,
and the volume of the movie is set to that value. From then on, setting this value only
affects the preferredVolume that will be saved with the movie, not the volume that will
be played.
Getter
get the preferredVolume of me
me (a QuickTimeMovie)
Setter
set the preferredvolume of me
to NewValue
me (a QuickTimeMovie)
to
previewMode of QuickTimeMovie
Type: a Boolean
The preview property allows your application to place a movie into and out of preview
mode. When a movie is in preview mode, only those tracks identified as preview tracks
are serviced.
Getter
get the previewMode of me
Setter
set the previewmode of me
to NewValue
Page 607
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p r e v i e w S e g m e n t o f Q u i c k Ti m e M o v i e
previewSegment of QuickTimeMovie
Type: { startTime (a NonNegativeInteger), duration (a
NonNegativeInteger) }
Getter
get the previewSegment of me
If the movie does not have a preview, both the startTime and duration are returned as 0.
(Adapted from IM-QuickTime, p. 2-123.)
me (a QuickTimeMovie)
Setter
set the previewsegment of me
to NewValue
me (a QuickTimeMovie)
to: See activeSegment for a description.
progressProc of QuickTimeMovie
Type: 'standardMovieProgessFunction'
When set to 'standardMovieProgessFunction' (the default), all Movie Toolbox
operations that call the progress proc will use the standard progress function.
Getter
get the progressProc of me
me (a QuickTimeMovie)
Setter
set the progressproc of me
to NewValue
me (a QuickTimeMovie)
to
Page 608
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r a t e o f Q u i c k Ti m e M o v i e
rate of QuickTimeMovie
Type: a Number
0 means the movie is stopped, 1 means normal speed, .5 means half-speed, 2 means
double-speed, -1 means reverse normal speed, etc.
This is the rate at which the movie is currently playing. If you want to set the rate, you
must do so via the movie's renderer.
Getter
get the rate of me
me (a QuickTimeMovie)
renderer of QuickTimeMovie
Type: a QuickTimeRenderer
Type: False
The QuickTimeRenderer that has this QuickTimeMovie as its media , if any, else
False .
Getter
get the Renderer of me
me (a QuickTimeMovie)
Setter
set the renderer of me
to NewValue
me (a QuickTimeMovie)
to
repeating of QuickTimeMovie
Type: one of { False, 'loop', 'palindrome' }
Page 609
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e s o u r c e N a m e o f Q u i c k Ti m e M o v i e
Getter
get the repeating of me
me (a QuickTimeMovie)
Setter
set the repeating of me
to NewValue
me (a QuickTimeMovie)
to
resourceName of QuickTimeMovie
Type: a String
Type: False
This property is set when the QuickTimeMovie was created if it came from a resource
that was specified by name.
Getter
get the resourceName of me
me (a QuickTimeMovie)
Page 610
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e s Ty p e o f Q u i c k Ti m e M o v i e
Setter
set the resourcename of me
to NewValue
resType of QuickTimeMovie
Type: a String of 4 characters.
Getter
get the resType of me
me (a QuickTimeMovie)
scale of QuickTimeMovie
Type: { horizontalScale (a Number), verticalScale (a Number) }
The scale numbers are extracted from the movie's matrix.
Getter
get the scale of me
me (a QuickTimeMovie)
Setter
set the scale of me
with dontforwardtorenderer
to NewValue
me (a QuickTimeMovie)
[with dontForwardToRenderer] (a Boolean): If my renderer is not False ,
a call to this setter causes a call to set scale of my renderer,
which in turn may call set scale of its media (me ) in addition to
taking other action. This argument is used in that case to prevent
infinite recursion. You will probably never need it.
to
See Also
preferredScale
Page 611
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e l e c t i o n o f Q u i c k Ti m e M o v i e
selection of QuickTimeMovie
Type: { startTime (a NonNegativeInteger), duration (a
NonNegativeInteger) }
Getter
get the selection of me
me (a QuickTimeMovie)
Setter
set the selection of me
to NewValue
me (a QuickTimeMovie)
to: See activeSegment for a description.
timeBase of QuickTimeMovie
Type: a QuickTimeTimeBase
Getter
get the timebase of me
me (a QuickTimeMovie)
Setter
set the timebase of me
to NewValue
timeScale of QuickTimeMovie
Type: a PositiveInteger.
The number of "timeValue" units per second for the movie.
Page 612
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t i m e Va l u e o f Q u i c k Ti m e M o v i e
The default QuickTime movie time scale is 600 units per second; however, this number
may change in the future. The default time scale was chosen because it is convenient for
working with common video frame rates of 30, 25, 24, 15, 12, 10, and 8. (Adapted from
IM-QuickTime p. 2-190.)
Getter
get the timeScale of me
me (a QuickTimeMovie)
Setter
set the timescale of me
to NewValue
In response to setting the timeScale , the Movie Toolbox adjusts the edit list of the
movie's tracks so that movie playback is unaffected. If you change a movie's time scale by
setting it to a smaller value (thereby losing precision in the movie's time values), the
Movie Toolbox may edit information from the movie. In general, you should only
increase the time scale value, and you should try to use integer multiples of the existing
time scale.
SPECIAL CONSIDERATIONS
Do not set timeScale if you have edited your movie. Doing so quantizes the beginning
and the end of the edits to the new units. Therefore, if you do not use an integral
multiple, the position of your edits may change. (Adapted from IM-QuickTime p. 2-189.)
me (a QuickTimeMovie)
to
timeValue of QuickTimeMovie
Type: a NonNegativeInteger -- up to 64 bits
The current time of the movie, in units of timeScale .
Getter
get the timeValue of me
Page 613
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t r a c k s o f Q u i c k Ti m e M o v i e
me (a QuickTimeMovie)
Setter
set the timevalue of me
with dontforwardtorenderer
to NewValue
me (a QuickTimeMovie)
[with dontForwardToRenderer] (a Boolean): If my renderer is not False ,
a call to this setter causes a call to set timeValue of my renderer,
which in turn may call set timeValue of its media (me ) in
addition to taking other action. This argument is used in that case to
prevent infinite recursion. You will probably never need it.
to
tracks of QuickTimeMovie
Type: a QuickTimeTrackCollection
A collection of QuickTimeTrack objects representing the tracks of the movie.
Getter
get the tracks of me
me (a QuickTimeMovie)
Setter
set the tracks of me
to NewValue
See Also
Page 614
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
v o l u m e o f Q u i c k Ti m e M o v i e
volume of QuickTimeMovie
Type: a Number
1 means full volume. .5 means half volume. Anything higher than 1 amplifies the sound
louder (which might cause clipping distortion). Anything 0 or less means no sound.
The value of volume can be changed while a movie is playing. If it is changed when the
movie is stopped, the new volume is used the next time the movie is played.
Getter
get the volume of me
me (a QuickTimeMovie)
Setter
set the volume of me
to NewValue
me (a QuickTimeMovie)
to
width of QuickTimeMovie
Type: a NonNegativeInteger
The width in pixels of the current size of the movie.
Getter
get the width of me
me (a QuickTimeMovie)
See Also
height of QuickTimeMovie
Page 615
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o p y S e l e c t i o n o f Q u i c k Ti m e M o v i e
Handlers of QuickTimeMovie
copySelection of QuickTimeMovie
copySelection me
Return type: a QuickTimeMovie
returns a new movie representing the selection.
Calls T_CopyMovieSelectionGC, IM-QuickTime p. 2-248.
me (a QuickTimeMovie)
[with dontForwardToRenderer] (a Boolean): If my renderer is not False ,
a call to this setter causes a call to copySelection of my renderer,
which in turn may call copySelection of its media (me ) in
addition to taking other action. This argument is used in that case to
prevent infinite recursion. You will probably never need it.
cutSelection of QuickTimeMovie
cutSelection me
with dontforwardtorenderer
Return type: a QuickTimeMovie
returns a new movie representing the selection (which is cut from the movie).
Calls T_CutMovieSelectionGC, IM-QuickTime p. 2-247.
me (a QuickTimeMovie)
[with dontForwardToRenderer] (a Boolean): If my renderer is not False ,
a call to this setter causes a call to cutSelection of my renderer,
which in turn may call cutSelection of its media (me ) in
addition to taking other action. This argument is used in that case to
prevent infinite recursion. You will probably never need it.
goToBeginning of QuickTimeMovie
goToBeginning me
with dontforwardtorenderer
Return type: none
Sets my timeValue to the beginning of the activeSegment or to the beginning of the
movie if activeSegment is False (i.e. not set).
Page 616
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
g o To E n d o f Q u i c k Ti m e M o v i e
me (a QuickTimeMovie)
[with dontForwardToRenderer] (a Boolean): If my renderer is not False ,
a call to this setter causes a call to goToBeginning of my renderer,
which in turn may call goToBeginning of its media (me ) in
addition to taking other action. This argument is used in that case to
prevent infinite recursion. You will probably never need it.
goToEnd of QuickTimeMovie
goToEnd me
with dontforwardtorenderer
Return type: none
Sets my timeValue to the end of the activeSegment or to the end of the movie if
activeSegment is False (i.e. not set).
me (a QuickTimeMovie)
[with dontForwardToRenderer] (a Boolean): If my renderer is not False ,
a call to this setter causes a call to goToEnd of my renderer, which
in turn may call goToEnd of its media (me ) in addition to taking
other action. This argument is used in that case to prevent infinite
recursion. You will probably never need it.
loadIntoRam of QuickTimeMovie
loadIntoRam me
with segment
with flags
with keepinram
with unkeepinram
with flushfromram
with loadforwardtrackedits
with loadbackwardtrackedits
Return type: a Boolean
True -- movie loaded successfully
False -- some or all of it could not be loaded because there was not enough memory.
Page 617
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o v i e P i c t u r e o f Q u i c k Ti m e M o v i e
me (a QuickTimeMovie)
[with segment]: see activeSegment virtual property for how this arg is
used
[with flags] (a NonNegativeInteger defaulting to 0): This argument can be
given as the OR of these flag bit values asan alternate way of specifying
the corresponding keyword arguments:TC_keepInRam
TC_unkeepInRamTC_flushFromRamTC_loadForwardTrackEdits
TC_loadBackwardTrackEdits
[with keepInRam] (a Boolean)
[with unkeepInRam] (a Boolean)
[with flushFromRam] (a Boolean)
[with loadForwardTrackEdits] (a Boolean)
[with loadBackwardTrackEdits] (a Boolean)
moviePicture of QuickTimeMovie
moviePicture me
with timevalue
Return type: a QDPicture
The returned QDPicture represents the movie at the present timeValue . Each
subsequent call will return a new and distinct QDPicture object.
me (a QuickTimeMovie)
[with timeValue] (a NonNegativeInteger)
nextInterestingTime of QuickTimeMovie
nextInterestingTime me
with starttime
with rate
with flags
with mediasample
with mediaedit
with trackedit
with syncsample
with edgeok
with ignoreactivesegment
with mediatypes
with interestingdurationwanted
with dontforwardtorenderer
Return type: timeValue (a NonNegativeInteger)
Return type: { timeValue (a NonNegativeInteger), duration (a
NonNegativeInteger) }
Page 618
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p a s t e S e l e c t i o n o f Q u i c k Ti m e M o v i e
me (a QuickTimeMovie)
[with startTime] (a NonNegativeInteger): a non-negative Integer
defaulting to my timeValue
[with rate] (a Number): a number defaulting to my preferredRate
[with flags] (a NonNegativeInteger defaulting to 0): This argument can be
given as the OR of these flag bit values asan alternate way of specifying
the corresponding keyword arguments:TC_nextTimeMediaSample
TC_nextTimeMediaEditTC_nextTimeTrackEditTC_nextTimeSyncSample
TC_nextTimeEdgeOKTC_nextTimeIgnoreActiveSegment
[with mediaSample] (a Boolean)
[with mediaEdit] (a Boolean)
[with trackEdit] (a Boolean)
[with syncSample] (a Boolean)
[with edgeOK] (a Boolean)
[with ignoreActiveSegment] (a Boolean)
[with mediaTypes] (a List defaulting to {"eyes"}): the list can contain "eyes",
"ears", or both.
[with interestingDurationWanted]: if this is True , then two values are
returned: {timeValue, duration}
[with dontForwardToRenderer] (a Boolean): If my renderer is not False ,
a call to this setter causes a call to nextInterestingTime of my
renderer, which in turn may call nextInterestingTime of its
media (me ) in addition to taking other action. This argument is used in
that case to prevent infinite recursion. You will probably never need it.
pasteSelection of QuickTimeMovie
pasteSelection me, sourcemovie
with dontforwardtorenderer
Return type: none
Pastes the given movie at the current selection.
Calls T_PasteMovieSelection, IM-QuickTime p. 2-249.
me (a QuickTimeMovie)
sourceMovie (a QuickTimeMovie)
[with dontForwardToRenderer] (a Boolean): If my renderer is not False ,
a call to this setter causes a call to pasteSelection of my
renderer, which in turn may call pasteSelection of its media
(me ) in addition to taking other action. This argument is used in that
case to prevent infinite recursion. You will probably never need it.
Page 619
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p o s t e r P i c t u r e o f Q u i c k Ti m e M o v i e
posterPicture of QuickTimeMovie
posterPicture me
Return type: a QDPicture
The returned QDPicture represents the movie's poster. Each call returns a new and
distinct QDPicture object.
me (a QuickTimeMovie)
preroll of QuickTimeMovie
preroll me
with starttime
with rate
Return type: none
Calls T_PrerollMovie, IM-QuickTime p. 2-135.
me (a QuickTimeMovie)
[with startTime] (a NonNegativeInteger): defaulting to my timeValue
[with rate] (a Number): defaulting to my preferredRate
putOnScrap of QuickTimeMovie
putOnScrap me
with flags
with dontzeroscrap
with onlyputmovie
Return type: none
Calls T_PutMovieOnScrap .
See PutMovieOnScrap, IM-QuickTime p. 2-24.
me (a QuickTimeMovie)
[with flags] (a NonNegativeInteger defaulting to 0): This argument can be
given as the OR of these flag bit values asan alternate way of specifying
the corresponding keyword arguments:
TC_movieScrapDontZeroScrapTC_movieScrapOnlyPutMovie
[with dontZeroScrap] (a Boolean)
[with onlyPutMovie] (a Boolean)
Page 620
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t r a c k F r o m I D o f Q u i c k Ti m e M o v i e
trackFromID of QuickTimeMovie
trackFromID me, id
Return type: a QuickTimeTrack
Return type: False
Given an id argument, returns the QuickTimeTrack object whose id property is the
same, or False if there is no such track.
This operation is equivalent to calling the T_GetMovieTrack function, but is implemented
differently because of the way the QuickTimeTrackCollection stays in sync with the
underlying Track objects.
See IM-QuickTime, p. 2-204.
me (a QuickTimeMovie)
id (a NonNegativeInteger)
QuickTimeRenderer
(a DynamicRenderer)
Example
new QuickTimeMovie with objectName "myMovie" with resourceFile myMovieFile
new QuickTimeRenderer with objectName "myPlayer"
set the fillColor of myRectangle to myPlayer
start myPlayer
See Also
QuickTimeMovie , Renderer, [DynamicRenderer]], Actor
Page 621
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a c t i v e o f Q u i c k Ti m e R e n d e r e r
Properties of QuickTimeRenderer
active of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls active of my
media with the given arguments and returns what it returns.
Getter
get the active of me
Setter
set the active of me
to NewValue
See Also
active of QuickTimeMovie
activeSegment of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls
activeSegment of my media with the given arguments and returns what it returns.
The setter raises an error if my media is False . Otherwise, calls set activeSegment
of my media with the given arguments and returns what it returns.
Getter
get the activeSegment of me
Setter
set the activesegment of me
to NewValue
See Also
activeSegment of QuickTimeMovie
Page 622
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a l i g n m e n t o f Q u i c k Ti m e R e n d e r e r
alignment of QuickTimeRenderer
Type: { horizontalAlignment, verticalAlignment } , each is a Number in the
range from 0 through 1.
When resizingStyle of me is set to resize the movie from the actor, and
maintainAspectRatio of me , the alignment property is used to determine how to
place the movie with respect to the Actor.
For horizontalAlignment, 0 means align to the left side, 1/2 means align to the center, 1
means align to the right side. Numbers in between work proportionately. For
verticalAlignment 0 means align to the top, and 1 means align to the bottom.
Getter
get the alignment of me
me (a QuickTimeRenderer)
Setter
set the alignment of me
to NewValue
me (a QuickTimeRenderer)
to
See Also
controllerVisible of QuickTimeRenderer
Type: a Boolean
Unless False the controller UI is made visible.
When True , state of me is not allowed to be 'stopped' , and if state is 'stopped'
it is changed to 'paused' . Any action that tries to set my state to 'stopped' will
instead set it to 'paused' .
When set from True to False , if usingBadge is True , the badge UI element is
displayed.
Page 623
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o u l d N o t R e s o l v e D a t a R e f e r e n c e o f
Q u i c k Ti m e R e n d e r e r
Getter
get the controllervisible of me
me (a QuickTimeRenderer)
Setter
set the controllervisible of me
to NewValue
me (a QuickTimeRenderer)
to
See Also
reservingRoomForController of QuickTimeRenderer,
usingBadge of QuickTimeRenderer
couldNotResolveDataReference of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls
couldNotResolveDataReference of my media with the given arguments and
returns what it returns.
Calling the setter raises an error.
Getter
get the couldNotResolveDataReference of me
Setter
set the couldnotresolvedatareference of me
to NewValue
See Also
couldNotResolveDataReference of QuickTimeMovie
creationtime of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls creationtime
of my media with the given arguments and returns what it returns.
Page 624
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d a t a R e f e r e n c e Wa s C h a n g e d o f
Q u i c k Ti m e R e n d e r e r
Getter
get the creationtime of me
Setter
set the creationtime of me
to NewValue
See Also
creationtime of QuickTimeMovie
dataReferenceWasChanged of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls
dataReferenceWasChanged of my media with the given arguments and returns
what it returns.
Calling the setter raises an error.
Getter
get the dataReferenceWasChanged of me
Setter
set the datareferencewaschanged of me
to NewValue
See Also
dataReferenceWasChanged of QuickTimeMovie
dataSize of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls dataSize of
my media with the given arguments and returns what it returns.
Getter
get the dataSize of me
See Also
dataSize of QuickTimeMovie
Page 625
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d o i n g I n v a l i d a t i n g o f Q u i c k Ti m e R e n d e r e r
doingInvalidating of QuickTimeRenderer
Type: a Boolean
;? I don't know what this does -DY.
Getter
get the doinginvalidating of me
me (a QuickTimeRenderer)
Setter
set the doinginvalidating of me
to NewValue
me (a QuickTimeRenderer)
to
duration of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls duration of
my media with the given arguments and returns what it returns.
Getter
get the duration of me
See Also
duration of QuickTimeMovie
file of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls file of my
media with the given arguments and returns what it returns.
Getter
get the File of me
Page 626
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
fi l e O f f s e t o f Q u i c k Ti m e R e n d e r e r
Setter
set the file of me
to NewValue
See Also
file of QuickTimeMovie
fileOffset of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls fileOffset
of my media with the given arguments and returns what it returns.
Getter
get the fileOffset of me
Setter
set the fileoffset of me
to NewValue
See Also
fileOffset of QuickTimeMovie
initialStateForNewMovie of QuickTimeRenderer
Type: one of { 'stopped', 'poster', 'paused', 'playing', False }
Unless initialStateForNewMovie of me is False , setting my media to a
QuickTimeMovie sets my state to initialStateForNewMovie of me .
Getter
get the initialStateForNewMovie of me
me (a QuickTimeRenderer)
Setter
set the initialstatefornewmovie of me
to NewValue
Page 627
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
k e y s E n a b l e d o f Q u i c k Ti m e R e n d e r e r
me (a QuickTimeRenderer)
to
See Also
keysEnabled of QuickTimeRenderer
Type: a Boolean
When True , keystrokes are consumed by the MovieController component instance
represented by me . There are various keystrokes that will start and stop MovieController
as well as doing other things to it. Unfortunately as of this writing, these keystrokes are
apparently undocumented.
;;? Find out what they are!
Getter
get the keysEnabled of me
me (a QuickTimeRenderer)
Setter
set the keysenabled of me
to NewValue
me (a QuickTimeRenderer)
to
See Also
maintainAspectRatio of QuickTimeRenderer
Type: One of: { 'fitInside', 'fitOutside', False }
If my resizingStyle is set to one of the styles that resizes the movie from the Actor
and this property is 'fitInside' or 'fitOutside' , then the movie will maintain its
preferredAspectRatio when it is resized. The alignment of me is consulted to
find out how to place the movie with respect to the Actor in the event that the fit is not
exact.
Page 628
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a t r i x o f Q u i c k Ti m e R e n d e r e r
Getter
get the maintainAspectRatio of me
me (a QuickTimeRenderer)
Setter
set the maintainaspectratio of me
to NewValue
me (a QuickTimeRenderer)
to
See Also
matrix of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls matrix of my
media with the given arguments and returns what it returns.
Getter
get the matrix of me
Setter
set the matrix of me
to NewValue
See Also
matrix of QuickTimeMovie
Page 629
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m e d i a o f Q u i c k Ti m e R e n d e r e r
media of QuickTimeRenderer
Type: a QuickTimeMovie or False
A QuickTimeRenderer is only really useful when its media is set to a
QuickTimeMovie . Many properties will have the value #Undefined# when this
property is False because there is no movie to report on, and there is no MovieController.
Getter
get the Media of me
me (a QuickTimeRenderer)
Setter
set the media of me
with initialstate
to NewValue
If my media already refers to a movie, the old MovieController component instance used
for that movie is discarded and a new one is made for the to argument if it isn't False .
If the to argument is False , then disassociates me with the old movie and the old
MovieController component instance.
Maintains the constraints that a QuickTimeMovie can be the media of only one
QuickTimeRenderer at a time, and a QuickTimeRenderer can be the renderer of
only one QuickTimeMovie at a time. If the to argument aleady has a renderer, then
that renderer's media is set to False before my media is set to the new movie. If my
media is already set to a movie, then that movie is released from me before my media is
set to the new movie.
me (a QuickTimeRenderer)
[with initialState] (a Symbol)
to
Page 630
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m e d i a D a t a o f Q u i c k Ti m e R e n d e r e r
Example
set myPlayer's media to a new QuickTimeMovie with file Spoonman
See Also
QuickTimeMovie
mediaData of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls mediaData of
my media with the given arguments and returns what it returns.
Getter
get the mediaData of me
Setter
set the mediadata of me
to NewValue
See Also
mediaData of QuickTimeMovie
modificationTime of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls
modificationTime of my media with the given arguments and returns what it
returns.
Calling the setter raises an error.
Getter
get the modificationtime of me
Setter
set the modificationtime of me
to NewValue
See Also
modificationTime of QuickTimeMovie
Page 631
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o v i e B o x o f Q u i c k Ti m e R e n d e r e r
movieBox of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls movieBox of
my media with the given arguments and returns what it returns.
Getter
get the movieBox of me
Setter
set the moviebox of me
to NewValue
See Also
movieBox of QuickTimeMovie
movieNumber of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls movieNumber
of my media with the given arguments and returns what it returns.
Getter
get the movieNumber of me
Setter
set the movienumber of me
to NewValue
See Also
movieNumber of QuickTimeMovie
newStateWhenDone of QuickTimeRenderer
Type: one of: { 'previous', 'inactive', 'stopped', 'poster', 'paused'
}
When the movie stops playing (i.e. it's done ), my state is set to the value of
newStateWhenDone of me .
Page 632
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p l a y i n g E v e r y F r a m e o f Q u i c k Ti m e R e n d e r e r
Getter
get the newStateWhenDone of me
me (a QuickTimeRenderer)
Setter
set the newstatewhendone of me
to NewValue
me (a QuickTimeRenderer)
to
See Also
playingEveryFrame of QuickTimeRenderer
Type: a Boolean
When True , the movie will play slower if necessary to ensure that every frame will
display, and if there are any sound tracks they are suppressed.
Getter
get the playingeveryframe of me
me (a QuickTimeRenderer)
Setter
set the playingeveryframe of me
to NewValue
me (a QuickTimeRenderer)
to
See Also
playWithNoOtherActivity of QuickTimeRenderer
playWithNoOtherActivity of QuickTimeRenderer
Type: a Boolean
Page 633
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p o s t e r Ti m e o f Q u i c k Ti m e R e n d e r e r
When True , every time my state is set to 'playing' , all other events are ignored until
the movie finishes playing. If this property is True and my repeating is not False , the
movie will play until you forcibly restart you system.
;? This is nuts. We should prevent this situation from occurring.
Getter
get the playWithNoOtherActivity of me
me (a QuickTimeRenderer)
Setter
set the playwithnootheractivity of me
to NewValue
me (a QuickTimeRenderer)
to
See Also
posterTime of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls posterTime
of my media with the given arguments and returns what it returns.
The setter raises an error if my media is False . Otherwise, calls set posterTime of
my media with the given arguments and returns what it returns.
Getter
get the posterTime of me
Setter
set the postertime of me
to NewValue
See Also
posterTime of QuickTimeMovie
preferredAspectRatio of QuickTimeRenderer
Type: a NonNegativeNumber
Page 634
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p r e f e r r e d R a t e o f Q u i c k Ti m e R e n d e r e r
Getter
get the preferredAspectRatio of me
me (a QuickTimeRenderer)
See Also
preferredRate of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls
preferredRate of my media with the given arguments and returns what it returns.
The setter raises an error if my media is False . Otherwise, calls set preferredRate
of my media with the given arguments and returns what it returns.
Getter
get the preferredRate of me
Setter
set the preferredrate of me
to NewValue
See Also
preferredRate of QuickTimeMovie
preferredScale of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls
preferredScale of my media with the given arguments and returns what it returns.
Page 635
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p r e f e r r e d S i z e o f Q u i c k Ti m e R e n d e r e r
Getter
get the preferredScale of me
Setter
set the preferredscale of me
to NewValue
See Also
preferredScale of QuickTimeMovie
preferredSize of QuickTimeRenderer
Type: { width (a NonNegativeInteger), height (a NonNegativeInteger)
}
Getter
get the preferredSize of me
me (a QuickTimeRenderer)
Setter
set the preferredsize of me
to NewValue
See Also
preferredSize of QuickTimeMovie
preferredVolume of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls
preferredVolume of my media with the given arguments and returns what it
returns.
The setter raises an error if my media is False . Otherwise, calls set
preferredVolume of my media with the given arguments and returns what it
returns.
Page 636
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p r e v i e w M o d e o f Q u i c k Ti m e R e n d e r e r
Getter
get the preferredVolume of me
Setter
set the preferredvolume of me
to NewValue
See Also
preferredVolume of QuickTimeMovie
previewMode of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls previewMode
of my media with the given arguments and returns what it returns.
The setter raises an error if my media is False . Otherwise, calls set previewMode
of my media with the given arguments and returns what it returns.
Getter
get the previewMode of me
Setter
set the previewmode of me
to NewValue
See Also
previewMode of QuickTimeMovie
previewSegment of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls
previewSegment of my media with the given arguments and returns what it returns.
Getter
get the previewSegment of me
Setter
set the previewsegment of me
to NewValue
Page 637
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p r e v i o u s S t a t e o f Q u i c k Ti m e R e n d e r e r
See Also
previewSegment of QuickTimeMovie
previousState of QuickTimeRenderer
Type: one of: { 'inactive', 'stopped', 'poster', 'paused', 'playing' }
Whenever my state makes a transition, the previous value is copied to my
previousState .
Getter
get the previousState of me
me (a QuickTimeRenderer)
Setter
set the previousstate of me
to NewValue
See Also
state of QuickTimeRenderer
progressProc of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls progressProc
of my media with the given arguments and returns what it returns.
The setter raises an error if my media is False . Otherwise, calls set progressProc
of my media with the given arguments and returns what it returns.
Getter
get the progressProc of me
Setter
set the progressproc of me
to NewValue
See Also
progressProc of QuickTimeMovie
Page 638
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r a t e o f Q u i c k Ti m e R e n d e r e r
rate of QuickTimeRenderer
Type: a Number
When my state is 'playing' then my rate is non-zero. 1 means normal speed, 0.5
means half speed, 2 means double-speed, -1 means reverse normal speed, etc.
Getter
get the rate of me
me (a QuickTimeRenderer)
Setter
set the rate of me
to NewValue
me (a QuickTimeRenderer)
to
See Also
state of QuickTimeRenderer
repeating of QuickTimeRenderer
Type: one of { False, 'loop', 'palindrome' }
When repeating of me is set to 'loop' , my activeSegment plays over and over
again in the direction of my rate . When repeating of me is set to 'palindrome' ,
my activeSegment plays in the direction of my rate , then reverses back and forth
continuously.
When repeating of me is False , the movie is done when it gets to the end of my
activeSegment .
Getter
get the repeating of me
Page 639
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e s e r v i n g R o o m F o r C o n t r o l l e r o f
Q u i c k Ti m e R e n d e r e r
me (a QuickTimeRenderer)
Setter
set the repeating of me
to NewValue
me (a QuickTimeRenderer)
to
See Also
reservingRoomForController of QuickTimeRenderer
Type: a Boolean
When True , increases the preferredSize by the size of the controller UI element. This
affects preferredAspectRatio which in turn affects the operations related to
resizingStyle .
Getter
get the reservingroomforcontroller of me
me (a QuickTimeRenderer)
Setter
set the reservingroomforcontroller of me
to NewValue
me (a QuickTimeRenderer)
to
See Also
Page 640
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e s i z i n g S t y l e o f Q u i c k Ti m e R e n d e r e r
resizingStyle of QuickTimeRenderer
Type: One of: { 'resizeMovieFromFill', 'resizeMovieFromFrame',
'resizeMovieFromRenderedRegion', 'resizeFillFromMovie',
'resizeFrameFromMovie', 'resizeRenderedRegionFromMovie', False }
When resizingStyle is False , the movie is simply displayed at its current scale ,
positioned according to my alignment , with the controller (if controllerVisible
of me ) visible in its normal position.
Getter
get the resizingStyle of me
me (a QuickTimeRenderer)
Setter
set the resizingstyle of me
to NewValue
me (a QuickTimeRenderer)
to
See Also
resourceID of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls resourceID
of my media with the given arguments and returns what it returns.
Page 641
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e s o u r c e N a m e o f Q u i c k Ti m e R e n d e r e r
Getter
get the resourceID of me
Setter
set the resourceid of me
to NewValue
See Also
resourceID of QuickTimeMovie
resourceName of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls resourceName
of my media with the given arguments and returns what it returns.
Getter
get the resourceName of me
Setter
set the resourcename of me
to NewValue
See Also
resourceName of QuickTimeMovie
scale of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls scale of my
media with the given arguments and returns what it returns.
Getter
get the scale of me
Setter
set the scale of me
to NewValue
Page 642
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e l e c t i o n o f Q u i c k Ti m e R e n d e r e r
See Also
scale of QuickTimeMovie
selection of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls selection of
my media with the given arguments and returns what it returns.
The setter raises an error if my media is False . Otherwise, calls set selection of
my media with the given arguments and returns what it returns.
Getter
get the selection of me
Setter
set the selection of me
to NewValue
See Also
selection of QuickTimeMovie
servicing of QuickTimeRenderer
Type: a Boolean
When True , means that the MovieController component instance represented by me is
getting events.
When my media is a QuickTimeMovie , servicing of me is True , and it is
permissible set it to False and back to True again.
Getter
get the servicing of me
me (a QuickTimeRenderer)
Setter
set the servicing of me
to NewValue
me (a QuickTimeRenderer)
to
Page 643
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s p e a k e r B u t t o n Vi s i b l e o f Q u i c k Ti m e R e n d e r e r
speakerButtonVisible of QuickTimeRenderer
Type: a Boolean
True means that the MovieController component is to show its speaker button.
True by default.
Getter
get the speakerbuttonvisible of me
me (a QuickTimeRenderer)
Setter
set the speakerbuttonvisible of me
to NewValue
me (a QuickTimeRenderer)
to
See Also
stepButtonsVisible of QuickTimeRenderer
state of QuickTimeRenderer
Type: one of: { 'inactive', 'stopped', 'poster', 'paused', 'playing' }
When my state is 'poster' , my timeValue is my posterTime , which means that
the poster frame is displayed.
Getter
get the state of me
me (a QuickTimeRenderer)
Setter
set the state of me
with nootheractivity
with rateset
to NewValue
Page 644
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s t e p B u t t o n s Vi s i b l e o f Q u i c k Ti m e R e n d e r e r
If the to argument is 'playing' , calls preroll me , then starts playing the movie from
its current timeValue and calls started of me .
If my state is 'playing' , and the to argument is not 'playing' , stops the movie
from playing and calls stopped of me .
me (a QuickTimeRenderer)
[with noOtherActivity] (a Boolean)
to
See Also
stepButtonsVisible of QuickTimeRenderer
Type: a Boolean
True means that the MovieController component is to show its step forward and
backward buttons.
True by default.
Getter
get the stepbuttonsvisible of me
me (a QuickTimeRenderer)
Setter
set the stepbuttonsvisible of me
to NewValue
me (a QuickTimeRenderer)
to
See Also
speakerButtonVisible of QuickTimeRenderer
Page 645
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t i m e B a s e o f Q u i c k Ti m e R e n d e r e r
timeBase of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls timeBase of
my media with the given arguments and returns what it returns.
Getter
get the timebase of me
Setter
set the timebase of me
to NewValue
See Also
timeBase of QuickTimeMovie
timeScale of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls timeScale of
my media with the given arguments and returns what it returns.
The setter raises an error if my media is False . Otherwise, calls set timeScale of
my media with the given arguments and returns what it returns.
Getter
get the timeScale of me
Setter
set the timescale of me
to NewValue
See Also
timeScale of QuickTimeMovie
timeValue of QuickTimeRenderer
Type: a NonNegativeInteger -- up to 64 bits
The current time of the movie, in units of timeScale .
Getter
get the timeValue of me
Page 646
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t r a c k s o f Q u i c k Ti m e R e n d e r e r
me (a QuickTimeRenderer)
Setter
set the timevalue of me
to NewValue
me (a QuickTimeRenderer)
to
See Also
timeValue of QuickTimeMovie
tracks of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls tracks of my
media with the given arguments and returns what it returns.
Getter
get the tracks of me
Setter
set the tracks of me
to NewValue
See Also
tracks of QuickTimeMovie
usingBadge of QuickTimeRenderer
Type: a Boolean
When True , the controller is to display a "badge" UI element when my state is not
'playing' and controllerVisible of me is False .
Page 647
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
u s i n g W i n d o w P a l e t t e o f Q u i c k Ti m e R e n d e r e r
Getter
get the usingbadge of me
me (a QuickTimeRenderer)
Setter
set the usingbadge of me
to NewValue
me (a QuickTimeRenderer)
to
See Also
controllerVisible of QuickTimeRenderer
usingWindowPalette of QuickTimeRenderer
Type: a Boolean
When the movie is playing, the window's color palette is used.
Default is False .
Getter
get the usingwindowpalette of me
me (a QuickTimeRenderer)
Setter
set the usingwindowpalette of me
to NewValue
me (a QuickTimeRenderer)
to
volume of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls volume of my
media with the given arguments and returns what it returns.
The setter raises an error if my media is False . Otherwise, calls set volume of my
media with the given arguments and returns what it returns.
Page 648
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w i d t h o f Q u i c k Ti m e R e n d e r e r
Getter
get the volume of me
Setter
set the volume of me
to NewValue
See Also
volume of QuickTimeMovie
width of QuickTimeRenderer
The getter returns #Undefined# if my media is False . Otherwise, calls width of my
media with the given arguments and returns what it returns.
Getter
get the width of me
Setter
set the width of me
to NewValue
See Also
width of QuickTimeMovie
Handlers of QuickTimeRenderer
copySelection of QuickTimeRenderer
copySelection me
Raises an error if my media is False . Otherwise, calls copySelection of my media
with the given arguments and returns what it returns.
See Also
Page 649
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c u t S e l e c t i o n o f Q u i c k Ti m e R e n d e r e r
cutSelection of QuickTimeRenderer
cutSelection me
Raises an error if my media is False . Otherwise, calls cutSelection of my media
with the given arguments and returns what it returns.
See Also
done of QuickTimeRenderer
done me
Return type: none
When my state transitions from 'playing' to some other state, done of me is called.
The done handler of QuickTimeRenderer sets my state to my newStateWhenDone .
Typically, a child of QuickTimeRenderer supplies its own specialized handler if it
wants to take action in this case, and must do inherited , usually before doing its own
processing.
me (a QuickTimeRenderer)
See Also
stopped of QuickTimeRenderer
goToBeginning of QuickTimeRenderer
goToBeginning me
Return type: none
Sets my timeValue to 0 .
me (a QuickTimeRenderer)
See Also
timeValue of QuickTimeRenderer
goToEnd of QuickTimeRenderer
goToEnd me
Return type: none
Sets my timeValue to my duration .
Page 650
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l o a d I n t o R a m o f Q u i c k Ti m e R e n d e r e r
me (a QuickTimeRenderer)
See Also
timeValue of QuickTimeRenderer
loadIntoRam of QuickTimeRenderer
loadIntoRam me
with segment
with flags
with keepinram
with unkeepinram
with flushfromram
with loadforwardtrackedits
with loadbackwardtrackedits
Raises an error if my media is False . Otherwise, calls loadIntoRam of my media
with the given arguments and returns what it returns.
See Also
loadIntoRam of QuickTimeMovie
moviePicture of QuickTimeRenderer
moviePicture me
with timevalue
Raises an error if my media is False . Otherwise, calls moviePicture of my media
with the given arguments and returns what it returns.
See Also
moviePicture of QuickTimeMovie
Page 651
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
n e x t I n t e r e s t i n g Ti m e o f Q u i c k Ti m e R e n d e r e r
nextInterestingTime of QuickTimeRenderer
nextInterestingTime me
with starttime
with rate
with flags
with mediasample
with mediaedit
with trackedit
with syncsample
with edgeok
with ignoreactivesegment
with mediatypes
with interestingdurationwanted
Raises an error if my media is False . Otherwise, calls nextInterestingTime of
my media with the given arguments and returns what it returns.
See Also
pasteSelection of QuickTimeRenderer
pasteSelection me, sourcemovie
Raises an error if my media is False . Otherwise, calls pasteSelection of my
media with the given arguments and returns what it returns.
See Also
pasteSelection of QuickTimeMovie
pause of QuickTimeRenderer
pause me
Return type: none
Calling this handler is the same as setting my state to 'paused' .
me (a QuickTimeRenderer)
See Also
Page 652
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p l a y o f Q u i c k Ti m e R e n d e r e r
play of QuickTimeRenderer
play me
with nootheractivity
Return type: none
Calling this handler is the same as setting my state to 'playing' . Unlike the start
handler, it does not alter my timeValue before setting my state to 'playing' .
me (a QuickTimeRenderer)
[with noOtherActivity] (a Boolean)
See Also
posterPicture of QuickTimeRenderer
posterPicture me
Raises an error if my media is False . Otherwise, calls posterPicture of my media
with the given arguments and returns what it returns.
See Also
posterPicture of QuickTimeMovie
preroll of QuickTimeRenderer
preroll me
with starttime
with rate
Raises an error if my media is False . Otherwise, calls preroll of my media with
the given arguments and returns what it returns.
See Also
preroll of QuickTimeMovie
putOnScrap of QuickTimeRenderer
putOnScrap me
with flags
with dontzeroscrap
with onlyputmovie
Raises an error if my media is False . Otherwise, calls putOnScrap of my media
with the given arguments and returns what it returns.
Page 653
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s h o w P o s t e r o f Q u i c k Ti m e R e n d e r e r
See Also
putOnScrap of QuickTimeMovie
showPoster of QuickTimeRenderer
showPoster me
Return type: none
Calling this handler is the same as setting my state to 'poster' .
me (a QuickTimeRenderer)
See Also
state of QuickTimeRenderer
start of QuickTimeRenderer
start me
with nootheractivity
Return type: none
Calling this handler is the same as calling goToBeginning of me then setting my
state to 'playing' .
me (a QuickTimeRenderer)
[with noOtherActivity] (a Boolean)
See Also
started of QuickTimeRenderer
started me
Return type: none
After my state transitions from some other state to 'playing' , started of me is
called.
The started handler of QuickTimeRenderer does nothing; typically, a child of
QuickTimeRenderer supplies its own specialized handler if it wants to take action in
this case.
me (a QuickTimeRenderer)
Page 654
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s t e p o f Q u i c k Ti m e R e n d e r e r
See Also
step of QuickTimeRenderer
step me
with by
with showingeveryframe
Return type: none
me (a QuickTimeRenderer)
[by:] (an Integer)
[with showingEveryFrame] (a Boolean)
Example
step myPlayer by: 2 with showingEveryFrame
See Also
nextInterestingTime of QuickTimeMovie
stop of QuickTimeRenderer
stop me
Return type: none
See Also
pause of QuickTimeRenderer
stopped of QuickTimeRenderer
stopped me, newstate
Return type: none
Called after my state transitions from 'playing' to another state, which is passed in
the newState argument.
Page 655
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t r a c k F r o m I D o f Q u i c k Ti m e R e n d e r e r
me (a QuickTimeRenderer)
newState (a Symbol): The new value for my state , which may or may not
still be 'playing' .
See Also
done of QuickTimeRenderer
trackFromID of QuickTimeRenderer
trackFromID me, id
Raises an error if my media is False . Otherwise, calls trackFromID of my media
with the given arguments and returns what it returns.
See Also
trackFromID of QuickTimeMovie
QuickTimeTimeBase
(an Object)
An object used to provide the time coordinate system of a QuickTimeMovie. It can also be used to
provide general-purpose timing services.
A QuickTimeTimeBase object is the SK8 manifestation of a low-level QuickTime TimeBase object. See
IM-QuickTime, pp. 2-315 through 2-332.
Example
To create a new QuickTimeTimeBase object that repeats every 1 second:
new QuickTimeTimeBase ¬
with startTime 0 ¬
with stopTime 1000000 ¬
with repeating 'loop' ¬
with rate 1
See Also
QuickTimeCallBack , QuickTimeMovie
Page 656
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c a l l b a c k s o f Q u i c k Ti m e Ti m e B a s e
Properties of QuickTimeTimeBase
callbacks of QuickTimeTimeBase
Type: a List
The QuickTimeCallBack objects associated with me .
Getter
get the callbacks of me
me (a QuickTimeTimeBase)
Setter
set the callbacks of me
to NewValue
me (a QuickTimeTimeBase)
to
See Also
effectiveRate of QuickTimeTimeBase
Type: a Number
Apparently always returns the same value as my ratte despite documentation
suggesting something more useful.
Getter
get the effectiveRate of me
me (a QuickTimeTimeBase)
Page 657
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a i n t a i n Ti m e B a s e Z e r o o f Q u i c k Ti m e Ti m e B a s e
maintainTimeBaseZero of QuickTimeTimeBase
Type: a Boolean
An obscure, difficult to explain flag was added to QuickTimeTimeBase objects in
QuickTime 2.0. Its overall effect is to make set timeValue do nothing. This is actually
useful in cases where TimeBases are being slaved together. (Adapted from "Qt 2.0 Toolbox
Changes" document.)
Getter
get the maintaintimebasezero of me
me (a QuickTimeTimeBase)
Setter
set the maintaintimebasezero of me
to NewValue
me (a QuickTimeTimeBase)
to
master of QuickTimeTimeBase
Type: One of { QuickTimeTimeBase, QuickTimeClockComponentInstance }
When you make a new QuickTimeTimeBase from scratch or you get a
QuickTimeTimeBase as the value of the timeBase of a QuickTimeMovie , its master is
a QuickTimeClockComponentInstance .
You can change the master to another or QuickTimeTimeBase , or
QuickTimeClockComponentInstance , but a
QuickTimeClockComponentInstance can be the master of only one
QuickTimeTimeBase .
Getter
get the master of me
One or the other of these calls will return something non-Nil, and the appropriate SK8
object representing that low-level object is returned.
me (a QuickTimeTimeBase)
Page 658
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o v i e o f Q u i c k Ti m e Ti m e B a s e
Setter
set the master of me
to NewValue
me (a QuickTimeTimeBase)
to
See Also
QuickTimeClockComponentInstance
movie of QuickTimeTimeBase
Type: One of: { a QuickTimeMovie, False }
Refers to a QuickTimeMovie if this QuickTimeTimeBase object if this TimeBase is used
by a Movie.
Getter
get the movie of me
me (a QuickTimeTimeBase)
Setter
set the movie of me
to NewValue
See Also
timeBase of QuickTimeMovie
Page 659
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r a t e o f Q u i c k Ti m e Ti m e B a s e
rate of QuickTimeTimeBase
Type: a Number
0 means my timeValue doesn't change with time, 1 means normal speed forward (my
timeValue gains my timeScale units per second), 0.5 means half-speed, 2 means
double-speed, -1 means reverse normal speed, etc.
Getter
get the rate of me
me (a QuickTimeTimeBase)
Setter
set the rate of me
to NewValue
me (a QuickTimeTimeBase)
to
repeating of QuickTimeTimeBase
Type: one of { False, 'loop', 'palindrome' }
When repeating of me is set to 'loop' , my timeValue advances repeatedly in the
direction of my rate between the extremes of my startTime and my stopTime .
When repeating of me is set to 'palindrome' , my timeValue advances in the
direction of my rate , then reverses back and forth continuously between the extremes of
my startTime and my stopTime .
Getter
get the repeating of me
me (a QuickTimeTimeBase)
Setter
set the repeating of me
to NewValue
Page 660
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s t a r t Ti m e o f Q u i c k Ti m e Ti m e B a s e
me (a QuickTimeTimeBase)
to
startTime of QuickTimeTimeBase
Type: a NonNegativeInteger -- up to 64 bits
When my timeValue moves backward to my startTime , then if my repeating =
False , my timeValue stops changing.
Getter
get the startTime of me
me (a QuickTimeTimeBase)
Setter
set the starttime of me
to NewValue
me (a QuickTimeTimeBase)
to
See Also
timeScale of QuickTimeTimeBase
Type: a NonNegativeInteger
The number of ticks per second of the TimeBase. Put another way, my timeValue
changes by my timeScale units per second.
If my master is a QuickTimeClockComponentInstance , then my timeScale is the
number of ticks per second of my master.
If my master is a QuickTimeTimeBase , then my timeScale = my master's
timeScale * my master's rate .
Getter
get the timeScale of me
me (a QuickTimeTimeBase)
Page 661
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t i m e Va l u e o f Q u i c k Ti m e Ti m e B a s e
See Also
timeValue of QuickTimeTimeBase
timeValue of QuickTimeTimeBase
Type: a NonNegativeInteger -- up to 64 bits
The current time of the TimeBase, in units of timeScale .
Getter
get the timeValue of me
me (a QuickTimeTimeBase)
Setter
set the timevalue of me
to NewValue
me (a QuickTimeTimeBase)
to
See Also
timeScale of QuickTimeTimeBase
Handlers of QuickTimeTimeBase
stopTime of QuickTimeTimeBase
stopTime me
Type: a NonNegativeInteger -- up to 64 bits
Page 662
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e n a b l e d o f Q u i c k Ti m e Tr a c k
me (a QuickTimeTimeBase)
See Also
QuickTimeTrack
(an Object)
See Also
tracks of QuickTimeMovie
Properties of QuickTimeTrack
enabled of QuickTimeTrack
Type: a Boolean
If this property is True , the track will be used when playing the movie.
If the track is a visual track (isVisual of my media ), and for some reason the movie is
not being shown on the screen, the enabled can be True but reallyEnabled can be
False . This is how we suppress the visible tracks when only the sound tracks are to be
played.
Getter
get the enabled of me
me (a QuickTimeTrack)
Page 663
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i d o f Q u i c k Ti m e Tr a c k
Setter
set the enabled of me
to NewValue
me (a QuickTimeTrack)
to
See Also
reallyEnabled of QuickTimeTrack
id of QuickTimeTrack
Type: NonNegativeInteger
Every QuickTime track has an ID that is unique with respect to its movie. If the track is
destroyed and a new track created, the ID is never reused for that movie.
Getter
get the id of me
me (a QuickTimeTrack)
Setter
set the id of me
to NewValue
See Also
trackFromID of QuickTimeMovie
media of QuickTimeTrack
Type: QuickTimeMedia
The QuickTimeMedia object associated with this track.
Getter
get the Media of me
me (a QuickTimeTrack)
Page 664
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o v i e o f Q u i c k Ti m e Tr a c k
Setter
set the media of me
to NewValue
See Also
QuickTimeMedia
movie of QuickTimeTrack
Type: QuickTimeMovie
The QuickTimeMovie object that owns this track.
Getter
get the movie of me
me (a QuickTimeTrack)
Setter
set the movie of me
to NewValue
reallyEnabled of QuickTimeTrack
Type: a Boolean
The system sets this property as needed depending on whether or not the movie is
playing on the screen or playing sound only.
Getter
get the reallyEnabled of me
me (a QuickTimeTrack)
Setter
set the reallyenabled of me
to NewValue
See Also
enabled of QuickTimeTrack
Page 665
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o v i e o f Q u i c k Ti m e Tr a c k C o l l e c t i o n
QuickTimeTrackCollection
(an IndirectCollection)
See Also
QuickTimeMovie
Properties of QuickTimeTrackCollection
movie of QuickTimeTrackCollection
Type: QuickTimeMovie
The movie that owns these tracks.
Getter
get the movie of me
me (a QuickTimeTrackCollection)
Setter
set the movie of me
to NewValue
RadioButton
(a Label)
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).
Page 666
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c h e c k c o l o r o f R a d i o B u t t o n
A RadioButton 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 RadioButton's
mouseSensitivity is 'opaque' , thus clicking anywhere on it checks or unchecks it.
See Also
check , checked .
Properties of RadioButton
checkcolor of RadioButton
Specifies the renderer to be used as the fillcolor of the RadioButton's highlightArea
(the oval inside the oval inside the RadioButton).
Getter
get the checkColor of me
me (a RadioButton)
Setter
set the checkcolor of me
to NewValue
me (a RadioButton)
to (a Renderer)
checked of RadioButton
When the checked property is set to True , the specified radioButton will be highlighted
(the oval contained in the highLightArea will become visible). Setting the checked
property to False unhilites the specified RadioButton. Checking a radioButton unchecks
all radioButtons that are clustered with it.
Getter
get the checked of me
me (a RadioButton)
Page 667
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h i g h l i g h t o f R a d i o B u t t o n
Setter
set the checked of me
to NewValue
me (a RadioButton)
to (a boolean): If True , the radioButton is checked.
highlight of RadioButton
The RadioButton redefines the set highlight handler to implement custom highlighting.
Setter
set the highlight of me
to NewValue
If the highlight is set to True , the framesize of the oval inside the radioButton is set
to {2,2} . Otherwise it is set back to {1,1} . After that we do the inherited handler.
me (a RadioButton)
to (a boolean)
See Also
highlight of Actor.
Handlers of RadioButton
check of RadioButton
check me
Calling this handler is equivalent to clicking on the radioButton. If it is checked, it
unchecks it. Otherwise it checks it.
me (a RadioButton)
See Also
checked .
Page 668
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h i g h l i g h t a r e a o f R a d i o B u t t o n
highlightarea of RadioButton
highlightArea me
Returns the little oval that appears when the radioButton is checked. It is the oval inside
the oval inside the radioButton.
me (a RadioButton)
mouseup of RadioButton
mouseUp me
Calls the radioButton's check handler.
me (a RadioButton)
See Also
check .
resized of RadioButton
resized me
Makes sure the vertical location of the oval in the radioButton is in the middle of the
radioButton.
me (a RadioButton)
togglestate of RadioButton
toggleState me
This handler is used by check to graphically show the change in states of the
radioButton. When checked, it sets the fillcolor of the radioButton's highlightArea
to the radioButton's checkcolor. Otherwise it sets it to the fillcolor of the oval inside
the radioButton (blending the highlight oval with its container).
me (a RadioButton)
Page 669
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n c r e m e n t o f R e a l Ti m e C l o c k
Real
(a Number)
This object is the ancestor of all real numbers. Real numbers are further categorized by Integer and
Float .
See Also
Integer, Float
RealTimeClock
(a Clock)
RealTimeClock is a clock that ticks a number of times per second. The ticksPerSecond property is
used to specify how often the clock should tick . This clock starts ticking immediately without
considering the masterOffset property.
See Also
ticksPerSecond and SecondsClock .
Properties of RealTimeClock
increment of RealTimeClock
The number of miliseconds between ticks. This value is computed when you set the
ticksPerSecond property.
Getter
get the increment of me
me (a RealTimeClock)
Page 670
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p r e v i o u s R e a l Ti m e o f R e a l Ti m e C l o c k
Setter
set the increment of me
to NewValue
me (a RealTimeClock)
to (a Number)
See Also
ticksPerSecond .
previousRealTime of RealTimeClock
Stores the last real time at which the clock ticked. The next tick will be whenever the
current real time of the machine is greater than the previousRealTime of the clock plus
its increment .
Getter
get the previousRealTime of me
me (a RealTimeClock)
Setter
set the previousrealtime of me
to NewValue
me (a RealTimeClock)
to (a Number)
See Also
running of RealTimeClock
Specifies whether the clock should be running or not.
Setter
set the running of me
to NewValue
Page 671
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t i c k s p e r s e c o n d o f R e a l Ti m e C l o c k
If the to argument is True , the clock's master is set to the SystemClock and the clock
starts running immediately. Otherwise its master is set to False , which causes the clock
to stop running.
me (a RealTimeClock)
to (a boolean)
See Also
SystemClock .
tickspersecond of RealTimeClock
The number of times that the clock updates in a second.
In some cases this may be an approximate value, based on the constraints of the system. In
addition, because of the nature of the master-slave hierarchy and the constraint that no
clock may run faster than its master, the range of ticksPerSecond that a clock may have is
usually quite limited.
To ensure a high ticking frequency, make your clock be a slave of the SystemClock.
Getter
get the ticksPerSecond of me
Setter
set the tickspersecond of me
to NewValue
Sets the ticksPerSecond property. Recomputes the value of the increment property.
me (a RealTimeClock)
to (an Interger): The number of ticks that should take place in the master
before the clock is ticked.
See Also
ticksPerSecond
Page 672
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p r e s e r v e o f R e a l Ti m e C l o c k
Handlers of RealTimeClock
preserve of RealTimeClock
preserve me
Sets the previousRealTime to 0 so that when the system comes up the clock is ready to
start ticking.
me (a RealTimeClock)
See Also
previousRealTime .
Rectangle
(an Actor)
Rectangles are four-sided shapes with perpendicular sides. A rectangle's sides are always parallel to the
axis. Rectangles are the most efficient actors around.
The children of Rectangle include: Label , Menu , Menubar, Picker, Scroller, EditText and
TextList .
Note: Rectangles are the only actors that can be attached to the Stage using a Macintosh window style
(eg. 'documentWithZoom' ). If you need to create such windows, rectangles should be used.◆
See Also
windowStyle , windowTitle .
Properties of Rectangle
windowstyle of Rectangle
This property specifies the type of window the rectangle will use when it is added to the
contents of the Stage. The options are: 'blank' (no window dressing), 'sk8Window' (a
Page 673
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w i n d o w t i t l e o f R e c t a n g l e
pleasant 3D looking frame), 'floating' (the typical windoid look) and the standard
Macintosh window styles: 'documentWithZoom' , 'documentWithZoomNoClose' ,
'documentWithGrow' , 'documentWithGrowNoClose' , 'document' ,
'documentNoGrow' , 'doubleEdgeBox' , 'singleEdgeBox' , 'shadowEdgeBox' ,
'tool' and 'movableDialog' .
Note: the windowStyle 'doubleEdgeBox' has the interesting property that when a
window with such style is the front window, you are prevented from switching
applications (leaving SK8 for another application). Bringing up one of these windows
seems to throw the Mac OS into a "modal dialog" state.◆
Getter
get the windowStyle of me
me (a Rectangle)
Setter
set the windowstyle of me
to NewValue
me (a Rectangle)
to: One of 'blank' , 'sk8Window' , 'floating' , 'documentWithZoom' ,
'documentWithZoomNoClose' , 'documentWithGrow' ,
'documentWithGrowNoClose' , 'document' ,
'documentNoGrow' , 'doubleEdgeBox' , 'singleEdgeBox' ,
'shadowEdgeBox' , 'tool' and 'movableDialog' .
windowtitle of Rectangle
Specifies the title of the rectangle's window. This title is only shown when a window style
with a title bar is used.
Getter
get the windowTitle of me
me (a Rectangle)
Setter
set the windowtitle of me
to NewValue
Page 674
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 R e c t a n g l e
me (a Rectangle)
to (a String)
See Also
windowStyle .
Handlers of Rectangle
getshapefromuser of Rectangle
getShapeFromUser me
with starth
with startv
with style
with shiftconstraint
with multipledraw
with boundsrectset
This handler provides a direct manipulation interface to obtain the boundsRect of a
rectangle. It should be invoked within a mouseDown event, at which point it lets the user
drag the outline of the rectangle from the mouseDown point to the current location of the
mouse. When the mouse is released, this handler returns the coordinates of the rectangle'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.
Page 675
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 R e c t a n g l e
me (a Rectangle)
[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 Rectangle 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 Rectangle. The opposite corner is
the point where the mouse is released. 'CenterOut' means that the
first point is the center of the rectangle and the point where the mouse is
released is a corner of the rectangle.
[with shiftconstraint] (a boolean): If True , pressing the shift key while
moving the mouse lets the user constrain the rectangle to be created to a
square. The default is True .
[with multipledraw] (a boolean): Specifies whether multiple draw of
rectangles is allowed. The default is False .
[with boundsrectset] (a boolean): If True , when the mouse is released, the
boundsRect of the rectangle given in the me argument is set to the
boundsRect specified. The default is False .
makeboundsregion of Rectangle
makeBoundsRegion me
Computes the rectangle's boundsRegion .
me (a Rectangle)
makefillregion of Rectangle
makeFillRegion me
Computes the rectangle's fillRegion . This is the boundsRegion inseted using the
values in the stored in the actor's frameSize .
me (a Rectangle)
See Also
framesize of Actor.
Page 676
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 R e c t a n g l e
makeframeregion of Rectangle
makeFrameRegion me
Computes the rectangle's frameRegion . This is the boundsRegion minus the
fillRegion .
me (a Rectangle)
minimumsize of Rectangle
minimumSize me
Specifies the minimum size that a rectangle can be. The setBoundsRect handler will
not let you shrink an actor beyond its minimum size. Returns {1,1} .
me (a Rectangle)
removingmeasparent of Rectangle
removingMeAsParent me, child, newparents
Performs all the necesary work to ensure that an object ceases to be a rectangle.
me (a Rectangle)
child
newparents
See Also
removingMeAsParent of Object .
Renderer
(an Effect)
A renderer is an object that knows how to "paint" a mask in an arbitrary way. Renderers implement the
render handler that gets called to paint some mask. All drawing in the graphics system is done by
calling render to paint parts of actors (the frame, the fill or the text regions).
SK8 comes with a wide variety of renderers which can be extended in various ways. The simplest way is
to make new renderers of types that are already supported and vary their parameters to obtain different
effects. You can do this with the renderer editors provided by the ProjectBuilder. If the renderer in
Page 677
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d y n a m i c o f R e n d e r e r
question involves media , the Import Media Dialog can be used to create it at the same time as new
media is brought into your project.
Advanced users might want to extend the renderer types by writing their own renderers.
See Also
render, translucent .
Properties of Renderer
dynamic of Renderer
Always returns False .
All descendants of DynamicRenderer return True . This property exists only to speed
up certain Actor operations. (It's faster to call the dynamic getter function than it would
be to call inheritsFrom DynamicRenderer ).
Getter
get the dynamic of me
me (a Renderer)
See Also
DynamicRenderer
Handlers of Renderer
getfromuser of Renderer
getFromUser me
with project
with multiplevalues
with popupmenu
with relativeactor
Given a renderer, displays a dialog for choosing any known child of that renderer.
Page 678
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e n d e r o f R e n d e r e r
me (a Renderer)
[with project]: Only shows renderers in this project. If this argument is
False no such filtering takes place.
[with multiplevalues]
[with popupmenu]: Ignored.
[with relativeactor]: Ignored.
render of Renderer
render me, theactor, region, thepaper
Paints the region passed to it in an arbitrary way. All drawing in the system is done
through calls to this handler.
Note: This handler should not be called directly by the user. The SK8 graphics system
calls render to draw all actors. If you want to redraw and actor use lightForceRedraw
instead.
Render gets called in the middle of the draw loop. You should not, in the body of this
handler, perform any action that might cause the draw loop to be asked to restart itself. If
you do you will crash your system. All you should be doing in this handler is Pen and
Mask operations and other calls to render. Examples of operations that will crash your
system are: showing and hiding the actor, changing the fillcolor, changing the
boundsRect , etc. Do not do it!◆
me (a Renderer)
theactor (an Actor): The actor currently being rendered. Most renderers
ignore this argument since all they do is paint the region passed to them.
region (a Mask): The mask that is 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
setFillColorActor of Renderer
setfillcoloractor me, theactor
Return type: a Renderer
Returns me . This handler is specialized by DynmicRenderer.
me (a Renderer)
theActor (an Actor)
Page 679
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e t F r a m e C o l o r A c t o r o f R e n d e r e r
See Also
setFrameColorActor of Renderer
setframecoloractor me, theactor
Return type: a Renderer
Similar to setFillColorActor of Renderer.
me (a Renderer)
theActor (an Actor)
See Also
setTextColorActor of Renderer
settextcoloractor me, theactor
Return type: a Renderer
Similar to setFillColorActor of Renderer.
me (a Renderer)
theActor (an Actor)
See Also
Translucent of Renderer
Translucent me
This handler should return True if the renderer is translucent. The default handler
returns False .
When you set the fillcolor (or frameColor ) of an actor, the system checks whether
the new color is translucent. If so, the actor is marked as translucent which changes
the way the graphics system draws it in order to achieve this effect. Drawing translucent
actors is a lot less efficient than drawing opaque actors and thus you should minimize the
use of this effect when possible.
Page 680
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
Tr a n s l u c e n t o f R e n d e r e r
Notice that this handler is not a property (you cannot set it to True ). If you make a new
renderer which is translucent, you should define this handler for it to return True .
Note: Since an actor changes from being considered opaque to translucent when you set
the fillcolor (or framecolor), redefining this handler will not update all actors that use this
renderer until the fillcolor is set again.◆
me (a Renderer)
Example
Consider a Rectangle called Pipo whose fillColor is set to coolRenderer (a renderer we
are working on). We now decide that coolRenderer should be translucent. First we
redefine the translucent handler of coolRenderer to return True . Then, to make Pipo
draw itself as a translucent actor we have to set its fillcolor to coolRenderer again.
on translucent of me (a coolRenderer)
return true
end translucent
set Pipo's fillcolor to coolRenderer
ResourceChooser
(a FileChooser)
A child of FileChooser which is specialized to go into resource files and select resources. It allows you
to navigate the file hierarchy normally. When a file that contains resources (in the resource fork) is
selected the ResourceChooser shows all the resource types in it. Doubleclicking on a resouce type
shows all the resources of that type.
When the user clicks on an individual resource, the outputHandle property of the resourceChooser is
set to a SK8 resource object (eg. QDPicture ) whose mediaData property has the handle to the resource
selected. Thus, you can turn this object into a browser component by adding an output port on the
outputHandle property.
You can see this object at work in the "Import Media Dialog".
Page 681
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o u t p u t H a n d l e o f R e s o u r c e C h o o s e r
Properties of ResourceChooser
outputHandle of ResourceChooser
Holds a media object that contains a the real media.
For example, if we just selected a "PICT" resource in the resourceChooser, a QDPicture
will be made and placed in this property. Note that if a QDPicture had been available
already in the handleHolders property, it would have been used.
Getter
get the outputHandle of me
me (a ResourceChooser)
Setter
set the outputhandle of me
to NewValue
me (a ResourceChooser)
to
See Also
handleHolders .
ResourceError
(a SystemError)
See Also
The Condition System section of the User Guide's SK8Script Language chapter
Page 682
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
f o r e b l u e o f R G B C o l o r
RGBColor
(a Renderer)
See Also
foreRed , foreGreen and foreBlue .
Properties of RGBColor
foreblue of RGBColor
The blue component of an RGBColor: 0 = off (Black), 65535 = Full strength.
Getter
get the foreBlue of me
me (an RGBColor)
Setter
set the foreblue of me
to NewValue
me (an RGBColor)
to (an Integer): The new value. Should be an integer between 0 to 65535.
foregreen of RGBColor
The green component of an RGBColor: 0 = off (Black), 65535 = Full strength.
Getter
get the foreGreen of me
Page 683
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
f o r e r e d o f R G B C o l o r
me (an RGBColor)
Setter
set the foregreen of me
to NewValue
me (an RGBColor)
to (an Integer): The new value. Should be an integer between 0 to 65535.
forered of RGBColor
The red component of an RGBColor: 0 = off (Black), 65535 = Full strength.
Getter
get the foreRed of me
me (an RGBColor)
Setter
set the forered of me
to NewValue
me (an RGBColor)
to (an Integer): The new value. Should be an integer between 0 to 65535.
Handlers of RGBColor
getnewfromuser of RGBColor
getNewFromUser me
with existingobject
with objectname
with project
Allows the user to create a new RGBColor (or to fill in an old rgbColor with new RGB
values). Brings up the color wheel to allow the selection.
Page 684
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e n d e r o f R G B C o l o r
me (a RGBColor)
[with existingobject]: Defaults to the object passed in the me argument. If
this argument is not False, the object passed in it is filled with the new
RGB values. Otherwise a new RGBColor is created.
[with objectname] (a String): The string to use to name the new color.
[with project] (a Project): If the existingObject argument is False , and
RGBColor will be created in this project.
render of RGBColor
render me, theactor, region, thepaper
Paints the region specified with the RGB color it represents.
me (a RGBColor)
theactor: The actor being rendered.
region: The mask 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.
RootDirectory
(a File)
A File object representing root directory of the main volume on this computer.
See Also
File, SK8Directory
RoundRect
(an Actor)
This is a rectangle with rounded corners. It has only one property: roundedness which controls the
roundedness of the RoundRect's corners.
Page 685
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r o u n d e d n e s s o f R o u n d R e c t
See Also
roundedness .
Properties of RoundRect
roundedness of RoundRect
This property controls how the rounding at the corners of the roundRect will be. The
roundRect is constructed by replacing the corners of a rectangle with ovals that are placed
on them. With this property, you control the size of these ovals.
The default value of this property is {'auto', 'auto'} , meaning that for both the
width and height of the Ovals, the system computes a default size. You can set this
property to two numbers, thus specifying yourself the size of the ovals to use.
Getter
get the roundedness of me
me (a RoundRect)
Setter
set the roundedness of me
to NewValue
me (a RoundRect)
to: A list of two items specifying the width and height of the ovals to use to
build the RoundRect's corners. Each value can be 'auto' or an integer.
In the first case, the system uses a suitable size for the ovals.
Page 686
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 R o u n d R e c t
Handlers of RoundRect
getshapefromuser of RoundRect
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 a
RoundRect. It should be invoked within a mouseDown event, at which point it lets the
user drag the outline of the RoundRect from the mouseDown point to the current location
of the mouse. When the mouse is released, this handler returns the coordinates of the
rectangle that would be necessary to inscribe the resulting RoundRect as a list of 4 values.
me (a RoundRect)
[with starth] (a Number): The horizontal location (in Stage coordinates) of
the start point of the outline drawing operation. If not given, the
location of the mouse is used.
[with startv] (a Number): The vertical location (in Stage coordinates) of the
start point of the outline drawing operation. If not given, the location of
the mouse is used.
[with style]: Use the style argument to specify how the RoundRect is to be
drawn. The default is 'CornerToCorner' , which means that the
starting point is one of the corners of the bounding rectangle. The
opposite corner is the point where the mouse is released. 'CenterOut'
means that the starting point is the center of the rectangle and the point
where the mouse is released is a corner of the rectangle.
[with multipledraw] (a boolean): If True , allows drawing of multiple
roundRects using the option key.
[with shiftconstraint] (a boolean): If True , pressing the shift key while
moving the mouse lets the user constrain the bounding rectangle to a
square. The default is True .
[with boundsrectset] (a boolean): If True , when the mouse is released, the
boundsRect of the RoundRect given as the me argument is set to the
boundsRect specified. The default is False .
makeboundsregion of RoundRect
makeBoundsRegion me
Page 687
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a k e fi l l r e g i o n o f R o u n d R e c t
Computes the RoundRect's boundsRegion . This is the largest RoundRect that can be
inscribed in the actor's boundsRect.
me (a RoundRect)
makefillregion of RoundRect
makeFillRegion me
Computes the RoundRect's fillregion : its boundsRegion minus its frameRegion .
me (a RoundRect)
makeframeregion of RoundRect
makeFrameRegion me
Computes the RoundRect's frameRegion : the boundsRegion minus the fillRegion .
me (a RoundRect)
setroundedness of RoundRect
setRoundedness me, width, height
Sets the roundedness of the RoundRect to the values specified.
me (a RoundRect)
width: Specifies the width to use for the ovals that will form the roundRect's
corners. Can be an integer or 'auto' meaning that the system will use
a suitable width.
height: Specifies the height to use for the ovals that will form the
RoundRect's corners. Can be an integer or 'auto' meaning that the
system will use a suitable height.
safeInputPort
(an InputPort)
An inputPort set to detect loops and stop propagating when that happens. Specifically, the port's
feedbackAction is set to 'stop'. These ports are heavily used by the Scrollers you see in the system.
Page 688
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b u t t o n p a n e l o f S c r i p t E d i t o r W i n d o w
safeOutputPort
(an OutputPort)
An outputPort set to detect loops and stop propagating when that happens. Specifically, the port's
feedbackAction is set to 'stop'. These ports are heavily used by the Scrollers you see in the system.
ScrapManagerError
(a SystemError)
See Also
The Condition System section of the User Guide's SK8Script Language chapter
ScriptEditorWindow
(a Rectangle)
This actor provides a rich interface to a script editor field (i.e. a ScriptEditText) and a variety of scripting
assistance and debugging tools. This is the preferred interface for editing handlers and functions.
Properties of ScriptEditorWindow
buttonpanel of ScriptEditorWindow
Getter
get the buttonPanel of me
Page 689
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e d i t o r o f S c r i p t E d i t o r W i n d o w
Setter
set the buttonpanel of me
to NewValue
editor of ScriptEditorWindow
Getter
get the editor of me
Setter
set the editor of me
to NewValue
inputhandler of ScriptEditorWindow
Getter
get the inputHandler of me
me (a ScriptEditorWindow)
Setter
set the inputhandler of me
to NewValue
me (a ScriptEditorWindow)
to
inputhandlerid of ScriptEditorWindow
Getter
get the inputHandlerid of me
Page 690
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
M e n u B a r o f S c r i p t E d i t o r W i n d o w
me (a ScriptEditorWindow)
Setter
set the inputhandlerid of me
to NewValue
me (a ScriptEditorWindow)
to
MenuBar of ScriptEditorWindow
Returns the menubar object component of me (a scriptEditorWindow)
Getter
get the MenuBar of me
Setter
set the menubar of me
to NewValue
myeditorsplitter of ScriptEditorWindow
Getter
get the myEditorSplitter of me
Setter
set the myeditorsplitter of me
to NewValue
myglobals of ScriptEditorWindow
Getter
get the myGlobals of me
Setter
set the myglobals of me
to NewValue
Page 691
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m y h s c r o l l e r o f S c r i p t E d i t o r W i n d o w
myhscroller of ScriptEditorWindow
Getter
get the myHScroller of me
Setter
set the myhscroller of me
to NewValue
mylocals of ScriptEditorWindow
Getter
get the myLocals of me
Setter
set the mylocals of me
to NewValue
myresizer of ScriptEditorWindow
Getter
get the myResizer of me
Setter
set the myresizer of me
to NewValue
mytoggler of ScriptEditorWindow
Getter
get the myToggler of me
Setter
set the mytoggler of me
to NewValue
Page 692
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m y v a r s p l i t t e r o f S c r i p t E d i t o r W i n d o w
myvarsplitter of ScriptEditorWindow
Getter
get the myVarSplitter of me
Setter
set the myvarsplitter of me
to NewValue
myvscroller of ScriptEditorWindow
Getter
get the myVScroller of me
Setter
set the myvscroller of me
to NewValue
versiondisplayed of ScriptEditorWindow
Getter
get the versionDisplayed of me
me (a ScriptEditorWindow)
Setter
set the versiondisplayed of me
to NewValue
me (a ScriptEditorWindow)
to
watcher of ScriptEditorWindow
Getter
get the watcher of me
Page 693
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a c t i v a t e o f S c r i p t E d i t o r W i n d o w
Setter
set the watcher of me
to NewValue
Handlers of ScriptEditorWindow
activate of ScriptEditorWindow
activate me
activates the window (i.e. me) then updates the expression-watcher pane
me (a ScriptEditorWindow)
availableversions of ScriptEditorWindow
availableVersions me
list of id's of all available versions of current handler (NOT FOUND)
me (a ScriptEditorWindow)
bestsize of ScriptEditorWindow
bestSize me
"Stack it on top of" the frontmost editor window, if there is one
me (a ScriptEditorWindow)
enteringstage of ScriptEditorWindow
enteringStage me
me (a ScriptEditorWindow)
initialize of ScriptEditorWindow
initialize me, original, isnew, initargs
0] Copy the tags...
Page 694
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l e a v i n g s t a g e o f S c r i p t E d i t o r W i n d o w
me (a ScriptEditorWindow)
original
child
args
leavingstage of ScriptEditorWindow
leavingStage me
me (a ScriptEditorWindow)
minimumsize of ScriptEditorWindow
minimumSize me
The minimumSize handler returns the minimumSize an actor can have (a list of 2 values).
Specifies the minimum size of the actor's boundsRect. The set boundsRect handler will not
let you shrink an actor beyond its minimum size. To specify the minimum size, you must
define a handler that returns a list of two values.
me (a ScriptEditorWindow)
mouseenter of ScriptEditorWindow
mouseEnter me
Mouseenter is called on the actor whenever the pointer enters the actor's bounds.
The actor's mouseSensitivity property determines whether the actor can receive a
mouseEnter message.
me (a ScriptEditorWindow)
newcontainerok of ScriptEditorWindow
newContainerOk me, container
The newcontainerok handler is one of the "consent" handlers. Both the new container and
the new content have to consent to the change in containers. The system will call these
two handlers FIRST to ensure that the change is agreeable to all.
Page 695
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e s e t l a y o u t o f S c r i p t E d i t o r W i n d o w
me (a ScriptEditorWindow)
container
resetlayout of ScriptEditorWindow
resetLayout me
me (a ScriptEditorWindow)
resized of ScriptEditorWindow
resized me
The resized event is sent each time an actor's boundsRect is set with the justMoving flags
set to False (the default).
me (a ScriptEditorWindow)
watchingmenuwatchingstate of ScriptEditorWindow
watchingMenuWatchingState me
me (a ScriptEditorWindow)
ScriptEditText
(an EditText)
At the heart of the ScriptEditorWindow, and providing the bulk of its functionality, the
ScriptEditText actor is much like the EditText actor, except that it treats its text as a SK8Script
handler (if its scriptType = False ), a SK8Script command (if its scriptType = 'command' ), a
SK8Script expression (if its scriptType = 'expr' ), or either a SK8Script expression or command —
like the field in the MessageBox — (if its scriptType = 'exprOrCommand' ).
A ScriptEditText automatically indents the SK8Script when there are multiple lines.
If its scriptType is one of the non-False options, a ScriptEditText will send itself the
scriptInputCompleted message whenever the Return or Enter key is typed and the text is a valid
piece of SK8Script conforming to the given scriptType.
Page 696
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a v a i l a b l e v e r s i o n s o f S c r i p t E d i t Te x t
Properties of ScriptEditText
availableversions of ScriptEditText
list of id's of all available versions of current handler (NOT FOUND)
Getter
get the availableVersions of me
Setter
set the availableversions of me
to NewValue
breakpointsvisible of ScriptEditText
Getter
get the breakPointsVisible of me
Setter
set the breakpointsvisible of me
to NewValue
me (a ScriptEditText)
to
dirty of ScriptEditText
Getter
get the dirty of me
me (a ScriptEditText)
Page 697
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d i s p l a y i n g a c t i v e v e r s i o n o f S c r i p t E d i t Te x t
Setter
set the dirty of me
with modification
to NewValue
me (a ScriptEditText)
[with modification]
to
displayingactiveversion of ScriptEditText
Getter
get the displayingActiveVersion of me
Setter
set the displayingactiveversion of me
to NewValue
me (a ScriptEditText)
to
globalvariables of ScriptEditText
the setter and getter for globalVariables property of me (a ScriptEditText)
Getter
get the globalVariables of me
Setter
set the globalvariables of me
to NewValue
Page 698
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h i g h l i g h t o f S c r i p t E d i t Te x t
highlight of ScriptEditText
Setter
set the highlight of me
to NewValue
me (a ScriptEditText)
to
inputhandler of ScriptEditText
The handler being edited by the ScriptEditText
Getter
get the inputHandler of me
me (a ScriptEditText)
Setter
set the inputhandler of me
with error
to NewValue
me (a ScriptEditText)
[with error]
to
inputhandlerid of ScriptEditText
An inputHandlerID is an alternative way to specify with Handler is being edited, it
consists of ???
Getter
get the inputHandlerid of me
Page 699
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l o c a l v a r i a b l e s o f S c r i p t E d i t Te x t
Setter
set the inputhandlerid of me
with creation
to NewValue
me (a ScriptEditText)
[with creation]
to
localvariables of ScriptEditText
specifies the local variables currently in the ScriptEditText
Getter
get the localVariables of me
Setter
set the localvariables of me
to NewValue
runningdepth of ScriptEditText
Getter
get the runningDepth of me
Setter
set the runningdepth of me
to NewValue
runningline of ScriptEditText
Getter
get the runningLine of me
Page 700
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r u n n i n g m o d e o f S c r i p t E d i t Te x t
Setter
set the runningline of me
to NewValue
runningmode of ScriptEditText
Getter
get the runningMode of me
Setter
set the runningmode of me
to NewValue
scripttype of ScriptEditText
Getter
get the scriptType of me
Setter
set the scripttype of me
to NewValue
me (a ScriptEditText)
to
versiondisplayed of ScriptEditText
Getter
get the versionDisplayed of me
Page 701
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
v i s i b l e o f S c r i p t E d i t Te x t
Setter
set the versiondisplayed of me
to NewValue
me (a ScriptEditText)
to
visible of ScriptEditText
Setter
set the visible of me
to NewValue
me (a ScriptEditText)
to
Handlers of ScriptEditText
activateversiondisplayed of ScriptEditText
activateVersionDisplayed me
with private
with locked
with watchingstate
with watchexpressions
with returntype
with documentation
with editorinfo
Activates and saves the version currently displayed.
Page 702
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a c t i v e v e r s i o n o f S c r i p t E d i t Te x t
me (a ScriptEditText)
[with private]
[with locked]
[with watchingstate]
[with watchexpressions]
[with returntype]
[with documentation]
[with editorinfo]
activeversion of ScriptEditText
activeVersion me
with error
returns True if the monitor is active (i.e., is actually turned on
me (a ScriptEditText)
[with error]
deleteearlierversions of ScriptEditText
deleteEarlierVersions me
with warning
me (a ScriptEditText)
[with warning]
deleteversiondisplayed of ScriptEditText
deleteVersionDisplayed me
with warning
me (a ScriptEditText)
[with warning]
displaymessage of ScriptEditText
displayMessage me, messagestring
me (a ScriptEditText)
messagestring
Page 703
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d o u b l e c l i c k i n b r e a k p o i n t o f S c r i p t E d i t Te x t
doubleclickinbreakpoint of ScriptEditText
doubleClickInBreakpoint me, linenum
Called when there's a doubleClick in a breakpoint button.
me (a ScriptEditText)
linenum
draggingmouseenter of ScriptEditText
draggingMouseEnter me, actordragged
me (a ScriptEditText)
actordragged
draggingmouseleave of ScriptEditText
draggingMouseLeave me, actordragged
me (a ScriptEditText)
actordragged
draggingmousewithin of ScriptEditText
draggingMouseWithin me, actordragged
me (a ScriptEditText)
actordragged
dropped of ScriptEditText
dropped me, droppee
Handle dropping a ObjectDataRect, a PropertyDataRect, or a HandlerDataRect onto me (a
ScriptEditText).
Note: eventually will handle expreesion being dropping onto the breakpoints◆
me (a ScriptEditText)
droppee
enterinfield of ScriptEditText
enterInField me
Page 704
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e n t e r i n g s t a g e o f S c r i p t E d i t Te x t
me (a ScriptEditText)
enteringstage of ScriptEditText
enteringStage me
me (a ScriptEditText)
evaluate of ScriptEditText
evaluate me
Evaluate me (a ScriptEditText)
Note: Handles both cases of a script that is a single expression or command, or a
complete handler.◆
me (a ScriptEditText)
forceredraw of ScriptEditText
forceRedraw me
with forceredraw
with updatescrollers
with justbreakpoints
me (a ScriptEditText)
[with forceredraw]
[with updatescrollers]
[with justbreakpoints]
handlekey of ScriptEditText
handleKey me, key
me (a ScriptEditText)
key
Page 705
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h a n d l e r d i s p o s e d o f S c r i p t E d i t Te x t
handlerdisposed of ScriptEditText
handlerDisposed me
with project
with name
set the text of me (a ScriptEditText) to the empty string, and update me
me (a ScriptEditText)
[with project]
[with name]
handlerstepped of ScriptEditText
handlerStepped me
Called when the handler has stepped (or traced a step).
me (a ScriptEditText)
handlerversionsaved of ScriptEditText
handlerVersionSaved me, version
with active
The default behavior is to do nothing.
me (a ScriptEditText)
version
[with active]
identifierhelp of ScriptEditText
identifierHelp me
Displays a help balloon with the text for the selected identifier in me (a scriptEditText)
me (a ScriptEditText)
idle of ScriptEditText
idle me
The default behavior is to do call the inherited handler.
Page 706
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n d i c a t e s c r i p t s y n t a x e r r o r o f
S c r i p t E d i t Te x t
me (a ScriptEditText)
indicatescriptsyntaxerror of ScriptEditText
indicateScriptSyntaxError me
with start
with end
with record
with description
Called in order to indicate a syntax error; the default bolds the bad token.
me (a ScriptEditText)
[with start]
[with end]
[with record]
[with description]
initialize of ScriptEditText
initialize me, original, isnew, initargs
Call the inherited handler, then if the original needs updating cause an update of me
Note: ignores child and args◆
me (a ScriptEditText)
original
child
args
keydown of ScriptEditText
keyDown me, key
The keyDown handler is called when the user presses down on a key.
me (a ScriptEditText)
key
leavingstage of ScriptEditText
leavingStage me
Page 707
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l e a v i n g v e r s i o n d i s p l a y e d o f S c r i p t E d i t Te x t
me (a ScriptEditText)
leavingversiondisplayed of ScriptEditText
leavingVersionDisplayed me
me (a ScriptEditText)
makefillregion of ScriptEditText
makeFillRegion me
makeFillRegion recomputes the fill region of the actor.
The fill region is the bounds region minus the frame region.
me (a ScriptEditText)
mousedown of ScriptEditText
mouseDown me
Mousedown is sent by SK8 whenever the mouse button is clicked over the actor.
The actor's mouseSensitivity property determines whether the actor can receive a
mouseDown message.
me (a ScriptEditText)
mousedowninbreakpoint of ScriptEditText
mouseDownInBreakpoint me, linenum
Called when there's a mouseDown in a breakpoint button.
me (a ScriptEditText)
linenum
mousedowninerrormarker of ScriptEditText
mouseDownInErrorMarker me
Called when there's a mouseDown in the runtime error marker.
Page 708
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o u s e e n t e r o f S c r i p t E d i t Te x t
me (a ScriptEditText)
mouseenter of ScriptEditText
mouseEnter me
Mouseenter is called on the actor whenever the pointer enters the actor's bounds.
The actor's mouseSensitivity property determines whether the actor can receive a
mouseEnter message.
me (a ScriptEditText)
mousewithin of ScriptEditText
mouseWithin me
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 .
The actor's mouseSensitivity property determines whether the actor can receive a
mouseWithin message.
me (a ScriptEditText)
oktomodifytext of ScriptEditText
okToModifyText me
Called before every textual modification; if it returns False , the modification doesn't
take place
me (a ScriptEditText)
preparefornewhandler of ScriptEditText
prepareForNewHandler me, handlerid
with justcreated
with private
with locked
with watchingstate
with watchexpressions
with returntype
with documentation
with editorinfo
Page 709
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p r e p a r e f o r n e w h a n d l e r v e r s i o n o f S c r i p t E d i t Te x t
me (a ScriptEditText)
handlerid
[with justcreated]
[with private]
[with locked]
[with watchingstate]
[with watchexpressions]
[with returntype]
[with documentation]
[with editorinfo]
preparefornewhandlerversion of ScriptEditText
prepareForNewHandlerVersion me, version
with oldversion
with justcreated
with private
with locked
with watchingstate
with watchexpressions
with returntype
with documentation
with editorinfo
Called when versionDisplayed changes.
me (a ScriptEditText)
version
[with oldversion]
[with justcreated]
[with private]
[with locked]
[with watchingstate]
[with watchexpressions]
[with returntype]
[with documentation]
[with editorinfo]
prepareforrunningmode of ScriptEditText
prepareforrunningmode me, running
Called when the handler is about to enter running mode.
Page 710
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e t u r n i n fi e l d o f S c r i p t E d i t Te x t
me (a ScriptEditText)
running
returninfield of ScriptEditText
returnInField me
This handler is called when the user pressed the return key and the keyTarget is me (a
ScriptEditText).
me (a ScriptEditText)
running of ScriptEditText
running me
Boolean; whether handler is currently running.
me (a ScriptEditText)
runningstopped of ScriptEditText
runningStopped me
Boolean; is running stopped at breakpoint/error.
me (a ScriptEditText)
runtimeerror of ScriptEditText
runtimeError me
False , or an error object (if stopped at an error).
me (a ScriptEditText)
Page 711
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s a v e v e r s i o n d i s p l a y e d o f S c r i p t E d i t Te x t
saveversiondisplayed of ScriptEditText
saveversiondisplayed me
with translation
with private
with locked
with watchingstate
with watchexpressions
with returntype
with documentation
with editorinfo
Saves the version currently displayed.
me (a ScriptEditText)
[with translation]
[with private]
[with locked]
[with watchingstate]
[with watchexpressions]
[with returntype]
[with documentation]
[with editorinfo]
scriptinputcompleted of ScriptEditText
scriptInputCompleted me, translation
Perform action needed wht script input is complete.
Default behavior for a ScriptEditText is to do nothing.
me (a ScriptEditText)
translation
tabinfield of ScriptEditText
tabInField me
me (a ScriptEditText)
targetproject of ScriptEditText
targetProject me
me (a ScriptEditText)
Page 712
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t e x t m o d i fi e d o f S c r i p t E d i t Te x t
textmodified of ScriptEditText
textModified me
me (a ScriptEditText)
update of ScriptEditText
update me
with indentation
me (a ScriptEditText)
[with indentation]
ScriptExpression
(an Object)
Handlers of ScriptExpression
getfromuser of ScriptExpression
getFromUser me
with initialexpr
with prompt
with location
with size
with project
with emptyallowed
Display a dialog prompting you to type in a Sk8Script expression
Page 713
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d e s c r i p t i o n o f S c r i p t S y n t a x E r r o r
me (a ScriptExpression)
[with initialexpr]
[with prompt]
[with location]
[with size]
[with project]
[with emptyallowed]
ScriptSyntaxError
(an Error)
See Also
The Condition System section of the User Guide's SK8Script Language chapter
Properties of ScriptSyntaxError
description of ScriptSyntaxError
Getter
get the description of me
Setter
set the description of me
to NewValue
errorposition of ScriptSyntaxError
Getter
get the errorPosition of me
Page 714
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n p u t o f S c r i p t S y n t a x E r r o r
Setter
set the errorposition of me
to NewValue
input of ScriptSyntaxError
Getter
get the input of me
Setter
set the input of me
to NewValue
Handlers of ScriptSyntaxError
writeobject of ScriptSyntaxError
writeObject me, thestream, rereadably
me (a ScriptSyntaxError)
thestream
rereadably
Scroller
(a Rectangle)
The Scroller is an actor that provides a graphical, direct manipulation way to select a value from a
range of values.
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
Page 715
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b o d y o f S c r o l l e r
changes, the picker's verticalScroll property is set to it. This can be done using ports as illustrated
in the partnerScroller property of Picker.
The SK8 scroller's thumb is constantly resized to provide an instant indication of how much of the
selection range is actually visible in the scrollee.
See Also
scrollStep , pageStep , minimumValue , maximumValue , currentValue and thumbView and
partnerScroller of Picker for a description of how to associate a picker to a scroller.
Properties of Scroller
body of Scroller
Returns the body of the scroller. The body is the rectangle you see under the scroller's
thumb.
Getter
get the body of me
me (a Scroller)
Setter
set the body of me
to NewValue
currentvalue of Scroller
This is the property that makes the scroller work. It represents the currently selected value
within the scroller's range. It is visually represented by the top of the scroller's thumb .
This is the property that is connected to the properties of objects that we want to control
with the scroller. This connection is done using ports.
Getter
get the currentValue of me
me (a Scroller)
Page 716
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d o w n a r r o w o f S c r o l l e r
Setter
set the currentvalue of me
to NewValue
Sets the currentValue of the scroller. Causes the thumb to move so that its top edge
coincides with the new value. If the currentValue if less than the minimumValue , the
minimumValue is used. Something very similar happens when the new value is greater
than the maximumValue .
me (a Scroller)
to (a Number)
See Also
downarrow of Scroller
Returns the scroller's downArrow.
Getter
get the downArrow of me
Setter
set the downarrow of me
to NewValue
maximumthumbsize of Scroller
Specifies the maximum size of the thumb in pixels. If this property is False , the thumb is
only constrained to be at most the size of the scroller's body (the area between the
upArrow and the downArrow).
This property is False for most scrollers. It is used by the Slider object.
Getter
get the maximumThumbSize of me
me (a Scroller)
Page 717
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a x i m u m v a l u e o f S c r o l l e r
Setter
set the maximumthumbsize of me
to NewValue
me (a Scroller)
to: An Integer specifying the maximum number of pixels for the thumb or
False to remove the constraint on the size.
See Also
Slider.
maximumvalue of Scroller
Specifies the end of the scroller's range. The scroller's currentValue is guaranteed to be
between the minimumValue and the maximumValue . The maximumValue has to be
greater than the minimumValue .
Getter
get the maximumValue of me
me (a Scroller)
Setter
set the maximumvalue of me
to NewValue
Note: This operation causes a rescaling of the thumb to take place. If you are going to be
setting other properties that cause this to happen you should consider using
setScrollerVals instead (which only rescales the thumb once).◆
me (a Scroller)
to (a Number): Should be greater than the Scroller's minimumValue .
See Also
setScrollerVals .
Page 718
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m i n i m u m t h u m b s i z e o f S c r o l l e r
minimumthumbsize of Scroller
The minimum size (in pixels) that the thumb will have. The thumb will thus reflect the
ratio of the range to the thumbview until the minimumThumbSize is reached. Defaults to
5 pixels.
Getter
get the minimumThumbSize of me
Setter
set the minimumthumbsize of me
to NewValue
minimumvalue of Scroller
Specifies the start of the scroller's range. The scroller's currentValue is guaranteed to be
between the minimumValue and the maximumValue . Has to be less than the
maximumValue .
Getter
get the minimumValue of me
me (a Scroller)
Setter
set the minimumvalue of me
to NewValue
Note: This operation causes a rescaling of the thumb to take place. If you are going to be
setting other properties that cause this to happen you should consider using
setScrollerVals instead (which only rescales the thumb once).◆
me (a Scroller)
to (a Number): The start of the scroller's range.
See Also
setScrollerVals .
Page 719
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p a g e s t e p o f S c r o l l e r
pagestep of Scroller
This property specifies the amount to change the scroller's currentValue when the user
clicks on the scroller's body. If the click happens below the thumb the currentValue is
incremented. Otherwise it is decremented.
Getter
get the pageStep of me
Setter
set the pagestep of me
to NewValue
See Also
currentValue .
scrollstep of Scroller
This property specifies the amount to increment or decrement the scroller's
currentValue when the user clicks on one of the scroller's arrows.
Getter
get the scrollStep of me
Setter
set the scrollstep of me
to NewValue
See Also
currentValue .
thumb of Scroller
Returns the Scroller's thumb.
Getter
get the thumb of me
Page 720
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t h u m b v i e w o f S c r o l l e r
Setter
set the thumb of me
to NewValue
thumbview of Scroller
This property specifies the number of values within the minimumValue and the
maximumValue that are visible in the scrollee at any time. It also determines the size of
the thumb (since it is proportional the the ratio of the range and the thumbview).
If the scrollee is a picker, for example, the thumbview is the number of items visible at any
one time. Consider one such picker with 100 items. We would then set the
minimumValue to 0, the maximumValue to 100. If 10 items are visible at any time, we
would set the thumbView to 10. The thumb will then become about 10% of the height of
the body (the area between the uparrow and the downarrow).
Getter
get the thumbView of me
me (a Scroller)
Setter
set the thumbview of me
to NewValue
Note: This operation causes a rescaling of the thumb to take place. If you are going to be
setting other properties that cause this to happen you should consider using
setScrollerVals instead (which only rescales the thumb once).◆
me (a Scroller)
to (a Number): Should be a number smaller than the range (the
maximumValue - the minimumValue ).
See Also
setScrollerVals .
uparrow of Scroller
Returns the scroller's upArrow.
Page 721
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a r r o w p r e s s e d r e n d e r e r o f S c r o l l e r
Getter
get the upArrow of me
Setter
set the uparrow of me
to NewValue
Handlers of Scroller
arrowpressedrenderer of Scroller
arrowPressedRenderer me, whicharrow
This handler returns the renderer that should be used to color a scroller arrow when it is
being pressed by the mouse. By redefining this handler, you can make your scrollers use
arbitrary graphics to indicate the pressed state.
me (a Scroller)
[whicharrow] (a Symbol): Specifies which arrow we are interested in. The
options are: 'down' (the default), 'up' , 'left' and 'right' .
rescalethumb of Scroller
rescaleThumb me
This handler recomputes the position and size of the scroller's thumb . It is called by the
system whenever some of the scroller values change. It is an expensive operation that you
should not need to perform.
me (a Scroller)
resized of Scroller
resized me
Calls bestSize for each item in the scroller's contents so that they fall in the proper
places.
me (a Scroller)
Page 722
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e t s c r o l l e r v a l s o f S c r o l l e r
setscrollervals of Scroller
setScrollerVals me
with minval
with maxval
with curval
with thumbview
with scrollstep
with pagestep
with finalredraw
This handler can be used to set all the scroller's values at once. It will set each of the values
specified. The advantages are that the scroller will be locked while all the properties are
being set and that the thumb will be rescaled only once after all the values have been set.
me (a Scroller)
[with minval] (a Number): The minimumValue . Should be less than the
maximumValue .
[with maxval]: Specifies the new maximumValue . A number that should be
greater than the minimumValue .
[with curval] (a Number): The currentValue . Should fall between the
minimumValue and the maximumValue .
[with thumbview] (a Number): The thumbView. Should be smaller or equal
to the range (the maximumValue - the minimumValue ).
[with scrollstep] (a Number): The scrollStep .
[with pagestep] (a Number): The pageStep .
[with finalredraw] (a boolean): Specifies whether the thumb should be
rescaled. Defaults to True .
See Also
thickness of Scroller
thickness me
If the scroller is vertical, returns the width of it. Otherwise it returns the height of it.
me (a Scroller)
update of Scroller
update me
Page 723
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b e s t s i z e o f S c r o l l e r B o d y
Moves the thumb so that its top edge corresponds to the new currentValue . There
should be no need for you to call this handler since the scroller is kept in a consistent state
by the system.
me (a Scroller)
scrollerArrow
(a Rectangle)
The parent of the ScrollerUpArrow and the ScrollerDownArrow. This class exists so that we may define
some handlers common to its two children.
ScrollerBody
(a Rectangle)
The body component of a scroller. This is the rectangle you see under the ScrollerThumb. Clicking on the
body below the thumb increments the Scroller's currentValue by the scroller's pageStep. Clicking above
the thumb does the reverse.
See Also
currentValue and pageStep of Scroller
Handlers of ScrollerBody
bestsize of ScrollerBody
bestSize me
This handler resizes the body of the scroller to fit within the scroller. The body, thus is the
scroller minus the arrows (the area where the thumb moves).
me (a ScrollerBody)
Page 724
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o u s e d o w n o f S c r o l l e r B o d y
mousedown of ScrollerBody
mouseDown me
While the mouse is held down on the Scroller's body, the Scroller's currentValue is
changed by the pageStep. If the mouse goes down above (or to the left of) the thumb, the
pageStep is subtracted from the currentValue. Otherwise it is added.
me (a ScrollerBody)
See Also
ScrollerDownArrow
(a ScrollerArrow)
The down arrow component of a scroller. Can turn itself into a right arrow if the scroller becomes
horizontal. On mouseDown , increments the currentValue of the scroller by the scrollStep .
See Also
currentValue and scrollStep of Scroller.
Handlers of ScrollerDownArrow
bestSize of ScrollerDownArrow
bestSize me
Recomputes the arrow's boundsRect to place it in the proper place within the scroller.
me (a ScrollerDownArrow)
mouseDown of ScrollerDownArrow
mouseDown me
While the mouse is down on the arrow, the arrow keeps incrementing the currentValue
of the scroller by the scroller's scrollStep .
Page 725
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o r i e n t a t i o n o f S c r o l l e r D o w n A r r o w
Within this handler we also change the fillColor of the arrow to a renderer that
indicates that the arrow is being pressed. The arrowPressedRenderer handler is called
to find the new renderer.
me (a ScrollerDownArrow)
See Also
orientation of ScrollerDownArrow
orientation me
This handler is called to find out whether the downArrow is currently a down arrow or a
right arrow. It returns 'down' or 'right' .
me (a ScrollerDownArrow)
See Also
orientation of Scroller.
ScrollerThumb
(a Rectangle)
The thumb component of a scroller. It is always kept proportional to the amount of data that is visible at
one time in the scrollee (as specified by the thumbview property of the Scroller). On mousedown, the
thumb can be dragged changing the currentValue in the process. The scroller's currentValue is
represented by the top edge of the thumb.
See Also
currentValue and thumbView of Scroller
Page 726
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b e s t s i z e o f S c r o l l e r T h u m b
Handlers of ScrollerThumb
bestsize of ScrollerThumb
bestSize me
Given the new size of the Scroller (the thumb's container) this handler computes the size
of the thumb and calls the update handler of the Scroller to align it to the right
currentValue.
me (a ScrollerThumb)
See Also
update of Scroller
mousedown of ScrollerThumb
mouseDown me
Drags the thumb within the body of the scroller. Each time the thumb moves, the
currentValue of the Scroller is set.
me (a ScrollerThumb)
ScrollerUpArrow
(a ScrollerArrow)
See Also
currentValue and scrollStep of Scroller.
Page 727
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b e s t S i z e o f S c r o l l e r U p A r r o w
Handlers of ScrollerUpArrow
bestSize of ScrollerUpArrow
bestSize me
Called to recompute the arrow's boundsRect to place itself in the right place within its
scroller.
me (a ScrollerUpArrow)
mouseDown of ScrollerUpArrow
mouseDown me
While the mouse is down on the arrow, the currentValue of its scroller is repeatedly
decremented by the scroller's scrollStep .
This handler also changes the arrow's fillColor to a renderer that shows that the arrow
is being pressed. The renderer to use is obtained by calling the arrowPressedRenderer
handler of the arrow.
me (a ScrollerUpArrow)
See Also
orientation of ScrollerUpArrow
orientation me
This handler is called to find out whether the arrow is currently acting as an up arrow or a
left arrow. It returns 'up' or 'left' .
me (a ScrollerUpArrow)
See Also
orientation of Scroller.
Page 728
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e l e c t e d i t e m o f
S e l e c t B y R o w Ta b l e P i c k e r A d d O n
SecondsClock
(a RealTimeClock)
See Also
RealTimeClock
SelectByRowTablePickerAddOn
(an Object)
This is an abstract object which is designed to be mixed into to a tablePicker There is a virtual
property called selectbyrows which can be set to True or False to add or remove this as a parent to
a table picker. This functionality makes a table picker act more like a picker, in that when you select an
item, it selects the entire row of that item. It does this by redefining the setters which specify selected
items: selectedItems , selectedItem , selection , and selectionStyle .
This is useful for making pickers with multiple fields. For example the propertySheetPicker in the
project builder's object editor is a picker with two columns, one for the property and second for values.
Properties of SelectByRowTablePickerAddOn
selecteditem of SelectByRowTablePickerAddOn
This has been redefined so that when this is set to one item, it selects that item's row.
Setter
set the selecteditem of me
with deselecting
to NewValue
me (a SelectByRowTablePickerAddOn)
[with deselecting]
to
Page 729
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e l e c t e d i t e m s o f S e l e c t B y R o w Ta b l e P i c k e r A d d O n
selecteditems of SelectByRowTablePickerAddOn
This has been redefined so that when this is set to some items, it selects the entire row of
each of the items. Note that duplicate items from the same row are allowed. Also note
that it will return all of the items which have been selected.
Setter
set the selecteditems of me
with deselecting
to NewValue
me (a SelectByRowTablePickerAddOn)
[with deselecting]
to
selection of SelectByRowTablePickerAddOn
This has been redefined so that when this is set to some indices, it selects the entire row of
each of the indices Note that duplicate indices from the same row are allowed. Also note
that it will return all of the indices which have been selected.
Setter
set the selection of me
with deselecting
with start
with end
with off
with selectionshown
to NewValue
me (a SelectByRowTablePickerAddOn)
[with deselecting]
[with start]
[with end]
[with off]
[with selectionshown]
to
selectionstyle of SelectByRowTablePickerAddOn
This has been redefined so that a selection style of 'single' will allow you to select one
whole row.
Page 730
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
S e l e c t B y R o w Ta b l e P i c k e r A d d O n
Setter
set the selectionstyle of me
to NewValue
me (a SelectByRowTablePickerAddOn)
to
SelectionDots
(an Actor)
Selection Dots is an actor with special geometry to allow simple creation of a MacDraw style selection.
This actor consists of eight tiny rectangles along the eight compass points of the actors boundsrect .
The size of the dots is controlled by the dotSize property.
It has some additional functionality for using these dots to resize some actors. By setting the
selectedItems property, you can specify which actors to control. It also has a liveResize property
to specify how resizing is done.
Example
First bring up the Draw Palette in the Project Builder and choose the "Palettes" option. Use it to draw out
a drawToolPalette on the stage. Name it "Pal". Next select the DrawTool tool and draw out a grid of
drawtools in your palette. Now try mousing down on them. Next draw a rectangle out on the stage and
name it "DrawingPaper". Add a selectiondots to the paper and tag it as the "Dots" of DrawingPaper.
Now write the following handler on your drawingPaper.
Voila MacDraw. Now try setting the actor to draw to different things for different tools.
on mousedown of me (a DrawingPaper)
set Tool to the CurrentTool of Pal
if the Tool is a SelectionTool then
selectwith tool
set the selecteditems of my Dots to the result
else
drawwith tool with container me
end if
end mousedown
See Also
fitToSelectedItems
Page 731
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d o t S i z e o f S e l e c t i o n D o t s
Properties of SelectionDots
dotSize of SelectionDots
The size of all eight dots is determined by this property. Like 'size', it takes a two number
list.
Getter
get the dotSize of me
Setter
set the dotsize of me
to NewValue
liveResize of SelectionDots
Determines if the resizing of the selectedItems is done live or non-live.
Getter
get the liveResize of me
Setter
set the liveresize of me
to NewValue
selectedItems of SelectionDots
If you set this property to a list of actors, the dots will surround this set of actors. In
addition, it will resize the actors when the user mousedowns and drags on the dots. This
is similar to the behavior one would find in a drawing program such as MacDraw.
Getter
get the selectedItems of me
Setter
set the selecteditems of me
to NewValue
Page 732
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
fi t T o S e l e c t e d I t e m s o f S e l e c t i o n D o t s
See Also
fitToSelectedItems
Handlers of SelectionDots
fitToSelectedItems of SelectionDots
fitToSelectedItems me
This handler insures that the dots are resized to surround the selecteditems .
me (a SelectionDots)
mousedown of SelectionDots
mouseDown me
If the dots have some selectedItems , mousing down will resize them.
me (a SelectionDots)
pointonwhichpart of SelectionDots
pointOnWhichPart me, x, y
This handler is will return the location on the dots where the x and y are located. Values it
returns are: 'topleft', top', 'topright', 'left', 'right',
'bottomleft', 'bottom' and 'bottomRight' . Note that these correspond to valid
arguments for the how argument of resize .
me (a SelectionDots)
x
y
SelectionTool
(a Rectangle)
Page 733
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a v o i d i n g o f S e l e c t i o n To o l
This is similar to the DrawTool only it is for selecting rather than drawing objects. It's selectWith
handler allows the user to draw out a shape, either a rectangle or a lasso,.and returns the set of objects
which are selected by this shape. The style of how objects are selected is completely configurable.
See Also
avoiding , selectionFunction , lasso
Properties of SelectionTool
avoiding of SelectionTool
This property can contain a list of items which are to be "avoided", that is they will not be
included among the list of possible items to select. This list specifies containers, thus all
items inside these actors will be avoided as well.
Getter
get the avoiding of me
Setter
set the avoiding of me
to NewValue
lasso of SelectionTool
This property can be set to either True or False . If True , the the user will select via a
lasso (i.e. drawing out an arbitrary shape). If it is set to False , then the user will select
with a rectangle.
Getter
get the lasso of me
Setter
set the lasso of me
to NewValue
Page 734
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e l e c t i o n f u n c t i o n o f S e l e c t i o n To o l
selectionfunction of SelectionTool
This is the function which is called to to use in determining what is selected. Examples of
this include FindSelectedActors and FindSelectedActorsGrow. Note that these
functions must take an avoiding and a container keyword.
Getter
get the selectionFunction of me
Setter
set the selectionfunction of me
to NewValue
Handlers of SelectionTool
deselected of SelectionTool
deselected me
This handler is called whenever the SelectionTool is deselected. By default it sets the
framecolor to uirectangleoutbevel .
me (a SelectionTool)
selected of SelectionTool
selected me
This handler is called whenever the SelectionTool is selected. By default it sets the
framecolor to uirectangleinbevel .
me (a SelectionTool)
selectwith of SelectionTool
selectWith me
with starth
with startv
with container
Page 735
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e l e c t w i t h o f S e l e c t i o n To o l
This allows the user to draw out a shape, either via rectangle or via lasso, to select items.
It returns the list of selected items. This handler should be called by a mousedown
handler.
me (a SelectionTool)
[with starth]: The starting horizontal postion for drawing the shape. This
defaults to the h of mouse .
[with startv]: The starting vertical postion for drawing the shape. This
defaults to the v of mouse .
[with container]: This specifies the container of the objects to be selected. By
default this will be false, which means that anything on the stage will be
selected. If a container is specified, then only objects in that containers
deepcontents will be considered in the selection.
SerialPortError
(a SystemError)
See Also
The Condition System section of the User Guide's SK8Script Language chapter
SimpleMenubar
(a MenuBar)
A menubar with "File", "Edit", and "Windows" menus. Provides the minimal functionality that a Project's
menubar might have. Thus you can make a child of this menubar and install it on the Stage for use in
your project.
SimplePropertyEditor
(a PropertyDataRect)
Page 736
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
L a b e l o f S i m p l e P r o p e r t y E d i t o r
This is the default simple property editor from which the NumberPropertyEditor and
TwoNumberPropertyEditor descend. It is a rectangle with a label inside.
Properties of SimplePropertyEditor
Label of SimplePropertyEditor
This tags the label of the editor.
Getter
get the Label of me
Setter
set the label of me
to NewValue
labeltext of SimplePropertyEditor
Getter
get the labeltext of me
This provides an alias for getting and setting the text of the label in the editor.
me (a SimplePropertyEditor)
Setter
set the labeltext of me
to NewValue
me (a SimplePropertyEditor)
to
Page 737
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c u r r e n t v a l u e o f S i m p l e P r o p e r t y E d i t o r
Handlers of SimplePropertyEditor
currentvalue of SimplePropertyEditor
currentValue me
This gets the current value specified in the property editor.
me (a SimplePropertyEditor)
resized of SimplePropertyEditor
resized me
This handler resizes the label of the editor as the editor changes size.
me (a SimplePropertyEditor)
writevalue of SimplePropertyEditor
writeValue me
This takes the current value specified in the property editor and writes it to the property.
me (a SimplePropertyEditor)
SK8
(a Project)
The SK8 project is the collection of all objects, handlers, globals and functions that comprise the core SK8
system, including items that might have been loaded as libraries into it. SK8 inherits from Project and is
therefore functionally and structurally equivalent to all other projects in SK8.
Note: The scripts for the SK8 project are not available to users in SK8 1.0. This is not necessarily the case
for libraries which do include sources and which are loaded into the SK8 project.◆
Example
get the project of Object
Page 738
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s y s t e m l o g o f S K 8
Properties of SK8
systemlog of SK8
The systemLog property contains the object which is the destination for all logged
objects. When the SK8 Project Builder is active, this is set to the MessageBox's output field.
Getter
get the systemLog of me
Setter
set the systemlog of me
to NewValue
sk8Clipboard
(a ClipBoard)
The only child of Clipboard. Used as the system's clipboard. All clipboard operations done by SK8 users
(including the Project Builder) use this object.
SK8Directory
(a File)
A File object representing the directory in which the Sk8 program resides.
See Also
File, RootDirectory
Page 739
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 S k e t c h R e n d e r e r
SK8HeapFullError
(a MemoryFullError)
See Also
The Condition System section of the User Guide's SK8Script Language chapter
SketchRenderer
(a Renderer)
Renders the background with a renderer specified in the backGroundRenderer property and draws
lines over that. The lines are drawn using the foreGroundRenderer.
The lines are specified as sets of endpoints in the linePoints property. All drawing is relative to the top
left corner of the region given to the render handler.
You can specify an RGBColor for the color of the pen and the size of the pen.
See Also
linePoints , penSize , foreGroundRenderer and backGroundRenderer.
Properties of SketchRenderer
backgroundrenderer of SketchRenderer
Specifies the renderer used to color the background.
Getter
get the backgroundRenderer of me
me (a SketchRenderer)
Setter
set the backgroundrenderer of me
to NewValue
Page 740
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
f o r e g r o u n d r e n d e r e r o f S k e t c h R e n d e r e r
me (a SketchRenderer)
to (a Renderer)
foregroundrenderer of SketchRenderer
Specifies the renderer used to color the pen. Should be an RGBColor.
Getter
get the foregroundRenderer of me
me (a SketchRenderer)
Setter
set the foregroundrenderer of me
to NewValue
me (a SketchRenderer)
to (an RGBColor)
linepoints of SketchRenderer
A list specifying each line that the renderer will draw. Format for each line is {startH,
startV, endH, endV} . The points are specified relative to the topleft of the boundsrect
of the region being rendered.
The following setting of this property would draw two lines:
{{10,10,100,100}, {30,50,60,80}}
Getter
get the linePoints of me
me (a SketchRenderer)
Setter
set the linepoints of me
to NewValue
me (a SketchRenderer)
to: A list of line specifications as described above.
Page 741
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p e n s i z e o f S k e t c h R e n d e r e r
pensize of SketchRenderer
Specifies the size of the pen to be used to render the lines. Should be a list of two integers:
{hSize, vSize}
Getter
get the penSize of me
me (a SketchRenderer)
Setter
set the pensize of me
to NewValue
me (a SketchRenderer)
to: A list of two integers of the form {hSize, vSize} .
Handlers of SketchRenderer
render of SketchRenderer
render me, theactor, region, thepaper
Paints the backgroundRenderer and then draws all the lines on it using the RGBColor
specified in the foreGroundRenderer property.
me (a SketchRenderer)
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.
See Also
Page 742
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a s t e r Ti c k s o f S l a v e C l o c k
SlaveClock
(a Clock)
A clock that ticks once for every n ticks of its master, where n is specified in the masterTicksPerTick
property which defaults to 10.
See Also
master, masterTicksPerTick .
Properties of SlaveClock
masterTicks of SlaveClock
We use this property to record the number of times the master has been ticked. When the
total number is divisible by the masterTicksPerTick , the clock is ticked.
Getter
get the masterTicks of me
Setter
set the masterticks of me
to NewValue
masterTicksPerTick of SlaveClock
Specifies the number of ticks in the master that are needed to produce one tick of the
clock. For example, if the masterTicksPerTick is 10, the clock will be ticked once for
every 10 ticks in the master.
Getter
get the masterTicksPerTick of me
Setter
set the mastertickspertick of me
to NewValue
Page 743
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t h i c k n e s s o f S l i d e r
See Also
master.
Slider
(a Scroller)
This is a slider object which can be used to allow a user to choose a particular value. In actuality, this
is simply a scroller that has no arrows and that has had hit's graphic appearance changed. Thus the
protocols which are used by scroller are also used here (e.g. minimumValue , MaximumValue ,
scrollStep ). Refer to Scroller for more information.
See Also
thickness
Handlers of Slider
thickness of Slider
thickness me
This handler returns the thickness of the bar of the slider. By default it returns ten. If
you wish to change the size of this bar, redefine this handler to return some other number
and call resized on the slider.
me (a Slider)
SmallFloat
(a Float)
This object is the parent of all compact-representation floating point numbers. This representation
supports floats in the range from -131071.99 to 131071.99.
Page 744
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t h i c k n e s s o f S l i d e r
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
BigFloat
SmallInteger
(an Integer)
This object is the parent of all compact-representation integers. This representation supports integers in
the range from -268435456 to 268435455.
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
BigInteger
SoundManagerError
(a SystemError)
See Also
The Condition System section of the User Guide's SK8Script Language chapter
SoundRSRC
(a Media)
Page 745
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c h a n n e l o f S o u n d R S R C
Properties of SoundRSRC
channel of SoundRSRC
Getter
get the channel of me
Setter
set the channel of me
to NewValue
Handlers of SoundRSRC
displaysample of SoundRSRC
displaysample me, theactor
Displays the media in the actor specified. In this case, all we do is play the soundRSRC
synchronously.
me (a SoundRSRC)
theActor (an Actor)
play of SoundRSRC
play me
with synchronously
Play me (a SoundRSRC)
me (a SoundRSRC)
[with synchronously]
stop of SoundRSRC
stop me
Page 746
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a b s o l u t e b o t t o m o f S p l i t t e r
me (a SoundRSRC)
splitter
(a Rectangle)
A general vertical splitter. Lets you specify which actors are above it and which are below it. The splitter
is constrained to being dragged vertically. When its vertical location is changed, all the actors affected
snap to the right position.
The Splitter assumes that it is in the same container as all the actors it controls.
See Also
absoluteBottom , absoluteTop , actorsAffected , actorAbove and actorBelow.
Properties of splitter
absolutebottom of Splitter
Returns the vertical location of the bottom of the splitter's area of influence. The bottom of
the actor's at the bottom of the splitter will never go below this value. This means that
while other actors in the splitter might be moved, the actors whose bottom is this value
can only be resized when the splitter moves.
Getter
get the absoluteBottom of me
me (a Splitter)
Setter
set the absolutebottom of me
to NewValue
me (a Splitter)
to (a Number)
Page 747
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a b s o l u t e t o p o f S p l i t t e r
absolutetop of Splitter
Returns the top of the Splitter's area of influence. The splitter ensures that the top of the
actor(s) at the head of the actorsAffected list coincides with this value always.
Getter
get the absoluteTop of me
me (a Splitter)
Setter
set the absolutetop of me
to NewValue
me (a Splitter)
to (a Number)
actorabove of Splitter
Returns a list of the actors whose bottom coincides with the top of the splitter (they "stick"
to the splitter's top ).
Getter
get the actorAbove of me
me (a Splitter)
Setter
set the actorabove of me
to NewValue
me (a Splitter)
to (a Number)
actorbelow of Splitter
Returns a list of the actors whose top coincides with the splitter's bottom (they "stick" to
the splitter's bottom ).
Page 748
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a c t o r s a f f e c t e d o f S p l i t t e r
Getter
get the actorBelow of me
me (a Splitter)
Setter
set the actorbelow of me
to NewValue
me (a Splitter)
to (a Number)
actorsaffected of Splitter
Returns an ORDERED list of the actors affected by the splitter. The list is to be ordered
from top to bottom.
Getter
get the actorsAffected of me
me (a Splitter)
Setter
set the actorsaffected of me
to NewValue
me (a Splitter)
to: An ordered list of the actors affected by the splitter.
Handlers of splitter
bestsize of Splitter
bestSize me
Aligns the top of the splitter to the bottom of the first item in the actorAbove property.
Then it resizes itself to be 2 pixels high and the span the width of its container.
Page 749
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d r a g o f S p l i t t e r
me (a Splitter)
drag of Splitter
drag me
with live
with otheractors
with dropevents
with draggedoverevents
with draggingmousewithinevents
with onstage
with constrainingrect
Drags the splitter constraining it to the bounds of its container. Since the splitter usually
spans the container's width , this results in just vertical dragging. When the mouse goes
up, all the actors affected are moved or resized to conform to the new position of the
splitter.
me (a Splitter)
[with live]: Ignored. The Splitter is dragged in outline (non live) mode.
[with otheractors]: Ignored.
[with dropevents]: Ignored.
[with draggedoverevents]: Ignored.
[with draggingmousewithinevents]: Ignored.
[with onstage]: Ignored.
[with constrainingrect]: If a rectangle in the form
{left,top,right,bottom} is provided, the drag is constrained to it.
That means that no part of the bounds of the splitter will ever exit the
constraining rect.
mousedown of Splitter
mouseDown me
Calls the drag handler to drag the splitter.
me (a Splitter)
See Also
drag .
mouseenter of Splitter
mouseEnter me
Page 750
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o u s e l e a v e o f S p l i t t e r
me (a Splitter)
mouseleave of Splitter
mouseLeave me
Sets the cursor of the Stage to the StandardCursor.
me (a Splitter)
splitactors of Splitter
splitActors me, actorsabove, actorsbelow, actorsAffected,
absoluteTop, absoluteBottom
This handler sets all the properties that set up the splitter for its work. It is a shortcut to
setting all properties individually.
me (a Splitter)
actorsabove: A list of actors whose bottoms will be snapped to the splitter's
top .
actorsbelow: A list of actors whose tops will be snapped to the splitter's
bottom .
actorsaffected: An ordered list of all the actors affected by the splitter. The
list is to be ordered from top to bottom and should include the actors in
the actorBelow and the actorAbove properties.
absolutetop (a Number): The top of the splitter's area of influence. It is
assumed that this is the top of the topmost actor in the
actorsAffected .
absolutebottom (a Number): The bottom of the splitter's area of influence. It
is assumed that this is the bottom of the bottom most actor in the
actorsAffected .
StackOverflowError
(a MemoryFullError)
See Also
The Condition System section of the User Guide's SK8Script Language chapter
Page 751
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h i s t o r y l e n g t h o f S t a c k Wa t c h e r
StackWatcher
(a BrowserPaper, UISimpleWindow (in project UI))
The calling-context watcher, or StackWatcher, shows which handlers are currently executing at any given
time. The handlers listed may be filtered by an arbitrary expression typed into its filter field. The
handlers are listed innermost-first, so the top handler in the list is the currently executing handler. It also
displays a graph of the history of the stack depth (the stack depth being the number of handlers currently
on the stack — i.e. currently executing).
Properties of StackWatcher
historylength of StackWatcher
Getter
get the historylength of me
me (a StackWatcher)
Setter
set the historylength of me
to NewValue
me (a StackWatcher)
to
running of StackWatcher
Boolean; whether StackWatcher is currently active or not.
Getter
get the running of me
Setter
set the running of me
to NewValue
Page 752
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s p e e d c o n t r o l o f S t a c k Wa t c h e r
me (a StackWatcher)
to
speedcontrol of StackWatcher
Getter
get the speedControl of me
Setter
set the speedcontrol of me
to NewValue
Handlers of StackWatcher
clearreferences of StackWatcher
clearReferences me
with objects
me (a StackWatcher)
[with objects]
enteringstage of StackWatcher
enteringStage me
me (a StackWatcher)
leavingstage of StackWatcher
leavingStage me
me (a StackWatcher)
reset of StackWatcher
reset me
Page 753
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e s i z e d o f S t a c k Wa t c h e r
me (a StackWatcher)
resized of StackWatcher
resized me
The resized event is sent each time an actor's boundsRect is set with the justMoving flags
set to False (the default).
me (a StackWatcher)
update of StackWatcher
update me
me (a StackWatcher)
Stage
(a Collection, Graphic)
The Stage , which can be conceived as the sum of all your monitor space, is the root of the containment
hierarchy. In order to be visible, an actor has to be ultimately contained by the Stage. All actors that are
directly contained by the Stage object becomes windows.
The Stage defines the physical coordinate system of SK8. The origin of this coordinate space (the {0,0}
point) is located at the topleft corner of the main monitor (the monitor with the menubar on it). The scale
of this system is 1 and the unit of measurement is the pixel. This means that if the physical size of an
actor is {100,30} , the actor is 100 pixels wide and 30 pixels high.
The Stage is special in that it is a unique object: you cannot create a new Stage . Thus, all your projects
share the Stage . This means that the Stage cannot be specialized by the user. SK8 provides a mechanism
for notifying objects in arbitrary projects about some events that happen to the Stage. Each object that
implements this mechanism actually chooses which events to support for notification. The Stage
supports notification for the following events: mouseEnter, mouseLeave , mouseDown , mouseUp and
dropped .
Note: since the Stage is the root of the containment hierarchy and many handlers follow the container
relation up to it, some handlers might be careless and treat the Stage as just another actor when the
Stage is not an actor at all. To guard against this eventuality, a number of Actor handlers have been
defined for the Stage . In most cases they do not do anything.◆
Page 754
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o n t e n t s o f S t a g e
See Also
contents , cursor, fillcolor, menubar and covered . For a discussion of the mechanism used to
notify other objects of Stage events, see the function dispatchtointerestedobjects .
Properties of Stage
contents of Stage
Getter
get the contents of me
Returns a collection of the actors whose immediate container is the Stage . Note that
everything returned will be a window.
me (a Stage)
Setter
set the contents of me
to NewValue
You cannot set the contents of the Stage . To add an actor to the Stage , set the actor's
container to the Stage .
me (a Stage)
to
See Also
container of Actor.
covered of Stage
Determines whether the Stage draws itself covering all other applications while SK8 is
the actiave application.
Note: You can only draw actors on the Stage when the Stage is covered .◆
Page 755
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c u r s o r o f S t a g e
Getter
get the covered of me
me (a Stage)
Setter
set the covered of me
to NewValue
me (a Stage)
to (a boolean): If True , the Stage will cover the finder and all other
applications.
cursor of Stage
The cursorRSRC whose form the pointer is currently adopting.
Getter
get the cursor of me
me (a Stage)
Setter
set the cursor of me
to NewValue
Sets the pointer to be the cursor specified. Nothing happens if the cursorLocked of the
Stage is True .
me (a Stage)
to: A cursorRSRC or an animatedCursor object.
See Also
cursorLocked .
Page 756
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c u r s o r l o c k e d o f S t a g e
cursorlocked of Stage
Specifies whether the cursor of the Stage can be changed. If True , setting the cursor of the
Stage has no effect.
Getter
get the cursorLocked of me
me (a Stage)
Setter
set the cursorlocked of me
to NewValue
me (a Stage)
to (a boolean)
See Also
cursor.
fillcolor of Stage
This property specifies the RGBColor used to render the Stage when it is covered .
Getter
get the fillColor of me
me (a Stage)
Setter
set the fillcolor of me
to NewValue
me (a Stage)
to (an RGBColor)
See Also
covered .
Page 757
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o u s e l o c o f S t a g e
mouseloc of Stage
This property specifies the physical location of the pointer.
Getter
get the mouseLoc of me
Returns a two-item list of the position of the mouse in the the Stage 's (physical)
coordinate system.
me (a Stage)
Setter
set the mouseloc of me
to NewValue
me (a Stage)
to: A list of two integers specifying the desired position of the mouse in
Stage coordinates.
Handlers of Stage
boundedbycontents of Stage
boundedByContents me
Always False .
me (a Stage)
boundsrect of Stage
boundsRect me
with physical
Returns the Stage 's four corners. Note that this is the rectangle that encloses all the
monitor space available in your system.
Page 758
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c l i c k o f S t a g e
me (a Stage)
[with physical] (a boolean): This argument is ignored. The boundsrect of
the Stage is always in physical coordinates.
click of Stage
click me
This handler does nothing. It is called when a click happens on the Stage .
me (a Stage)
commandkeyevent of Stage
commandKeyEvent me, thechar
Dispatches the command key event to the menubar installed on the Stage .
me (a Stage)
thechar (a Character): The character in the CMD-character the user has
pressed.
container of Stage
container me
The container of the Stage is False .
me (a Stage)
deepcontents of Stage
deepContents me
Deepcontents returns a list, of ALL actors contained by the Stage (directly and indirectly).
me (a Stage)
doubleclick of Stage
doubleClick me
The default behaviour for clicking on the stage is to do nothing.
Page 759
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 S t a g e
me (a Stage)
draggingmouseenter of Stage
draggingMouseEnter me, actordragged
This handler is called when a drag with draggedOverEvents is in process and the
actor being dragged enters the bounds of the Stage . The default handler does nothing.
me (a Stage)
actordragged (an Actor): The actor being dragged over the Stage .
See Also
drag , draggingMouseLeave .
draggingmouseleave of Stage
draggingMouseLeave me, actordragged
This handler is called when a drag with draggedOverEvents is in process and the
actor being dragged leaves the bounds of the Stage. Now, really, how could this happen?
The default handler does nothing.
me (a Stage)
actordragged (an Actor): The actor being dragged over the Stage .
See Also
drag , draggingMouseEnter.
draggingmousewithin of Stage
draggingMouseWithin me, actordragged
This handler is called when a drag with draggingMouseWithinEvents is in process
and the actor being dragged is within bounds of the Stage . The default handler does
nothing.
me (a Stage)
actordragged (an Actor): The actor being dragged over the Stage .
See Also
drag .
Page 760
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d r o p p e d o f S t a g e
dropped of Stage
dropped me, thing
This handler gets called when an actor that was being dragged is dropped on the Stage .
The default handler notifies any interested parties of the event.
me (a Stage)
thing: The Actor that was being dragged with dropEvents and was
dropped on the Stage .
See Also
hmouse of Stage
hMouse me
The hMouse handler returns an integer that indicates the horizontal position of the mouse
pointer in the Stage 's coordinate system.
me (a Stage)
See Also
mouseLoc .
mousedown of Stage
mouseDown me
Mousedown is sent by SK8 whenever the mouse button is clicked over the Stage and the
Stage is covered . The default handler dispatches the event to any interested objects.
me (a Stage)
See Also
mouseenter of Stage
mouseEnter me
This handler is called whenever the pointer enters the Stage 's bounds. This handler
dispatches the mouseEnter event to any interested objects and then sets the cursor of the
Stage to the StandardCursor.
Page 761
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o u s e l e a v e o f S t a g e
me (a Stage)
See Also
mouseleave of Stage
mouseLeave me
Mouseleave is called on the actor whenever the pointer leaves the actor's bounds. The
default handler dispatches the event to any interested parties.
Note: One is forced to ask the deep question: "how can the mouse escape the boundsRect
of the Stage?" Well... it turns out that if the eventActor ever becomes False ,
mouseLeave will be called on the Stage . This can actually happen when the
eventActor 's project is closed, for example.◆
me (a Stage)
See Also
mouseup of Stage
mouseUp me
Mouseup is invoked on the Stage whenever the pointer goes up on it. The default
handler dispatches the event to any interested parties.
Note: The Stage can only get mouseUp events when it is covered .◆
me (a Stage)
See Also
newcontentok of Stage
newContentOk me, newcontent
This handler is called when newContent is about to be added to the contents of the
Stage . The Stage returns True regardless, meaning it consents to the change in
containment.
Page 762
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e s i z e s c o n t e n t s o f S t a g e
me (a Stage)
newcontent: The Actor that is being added to the contents of the Stage .
resizescontents of Stage
resizesContents me
Always False .
me (a Stage)
size of Stage
size me
This is the size of the Stage 's boundsRect .
me (a Stage)
See Also
boundsRect .
vmouse of Stage
vMouse me
The vMouse handler returns an integer that indicates the vertical position of the mouse
pointer in the Stage 's coordinate system.
me (a Stage)
See Also
mouseLoc .
window of Stage
window me
The window of the Stage is itself.
me (a Stage)
Page 763
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w i n d o w s o f S t a g e
windows of Stage
windows me
Returns the contents of the Stage .
me (a Stage)
See Also
contents .
StorageDevice
(a Device)
Prototype represents a storage device in the current system environment. To get all of the storage devices
connected to the system:
get the children of StorageDevice
The devices must be queried to get specific storage device characteristics.
The children of StorageDevice are all secondary storage devices attached to the system. Generally, these
are disks, although they may also be CD-ROM players and other input/output devices.
You may get all children of storageDevice by asking for the children of storageDevice:
get the storage devices of the System
The following capabilities are supported:
get the name of myStorageDevice
name returns a string representing the name of the storage device.
On the Macintosh, this is the name of your volume as shown in the Finder.
get the number of myStorageDevice
number returns the volume number of your storage device
get the drive of myStorageDevice
drive returns the drive number of your storage device
if myStorageDevice is ejected then ....
ejected returns True whenever the storage device has been ejected
flush myStorageDevice
flush flushes all buffers to the storage device
unmount myStorageDevice
Page 764
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d r i v e o f S t o r a g e D e v i c e
Handlers of StorageDevice
drive of StorageDevice
drive me
Returns the drive number of the storage device.
me (a StorageDevice)
Example
get the drive of the StorageDevice
ejected of StorageDevice
ejected me
Rreturns True if the media in the storage device has been rejected, and returns False
otherwise. This is useful if the device is a removable drive or floppy drive.
me (a StorageDevice)
Example
get ejected(StorageDevice)
flush of StorageDevice
flush me
Flushes the write buffer to the storage device.
me (a StorageDevice)
Number of StorageDevice
Number me
Returns the volume number of the storage device.
Page 765
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
u n m o u n t o f S t o r a g e D e v i c e
me (a StorageDevice)
Example
get the number of the StorageDevice
unmount of StorageDevice
unmount me
Unmounts the StorageDevice.
me (a StorageDevice)
Stream
(a Collection)
The parent of TextStream and ByteStream. Stream itself is not intended to be used as a prototype for
building objects, although handlers common to TextStreams and ByteStreams these are written on Stream.
See Also
TextStream, ByteStream
Handlers of Stream
flush of Stream
flush me
To be used on a TextStream or ByteStream writing out to a file. Flush ensures that any
data written to the stream and queued up has been actually written out to disk.
me (a Stream)
Page 766
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c r e a t e Te x t I t e m S t y l e o f S t y l e d P i c k e r
Example
writeString (MyTextStream, "It's really important that this is written out to disk now.")
flush(MyTextStream)
StyledPicker
(a Picker)
The StyledPicker is a Picker that supports different styles for arbitrary items displayed. It lets you
set the textColor, textFont , textSize and textStyle of any arbitrary item. Recall that the picker
stores a list of items and a list of strings representing these items. The styledPicker has a new property
called styles that specifies the style of each item.
See Also
createTextItemStyle
Properties of StyledPicker
Handlers of StyledPicker
createTextItemStyle of StyledPicker
createTextItemStyle me, targetitem, thestring, position
The StyledPicker calls this handler to specify the Style of each item it is going to draw.
This handler should return a list of four values having the following format:
{font, fontsize, fontstyle, color}
The font is a descendant of font . For example, Monaco.
The fontSize is an integer.
The fontStyle is a list of styles. For example, Monaco {'bold', 'underline'} .
The color is a descendant of RGBcolor. For example, Red .
If for any of these you want to use the default values, return False .
Page 767
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i t e m b o u n d s r e c t o f S t y l e d P i c k e r
me (a StyledPicker)
item: The item about to be drawn. eg. Scroller
thestring: The string representation of the item. eg. "Scroller"
position: The position of the item in the items of the picker.
Example
As an example, consider the following handler in which we change the style of every item
whose position in the StyledPicker's items is odd.
on createTextItemStyle (me (a styledPicker), item, theString,
position)
if position is odd then
return {"Monaco", False, {':bold', ':condense'}, Red}
else
return {False, False, False, False}
end if
end createTextItemStyle
itemboundsrect of StyledPicker
itemBoundsRect me, index
with physical
return a (left, top, right, bottom) coordinates of the cell for the item at the given index
me (a StyledPicker)
index
[with physical]
pointonwhichpart of StyledPicker
pointOnWhichPart me, x, y
with part
with tracking
This handler is called when the user wants to figure out on which item a point falls. The
point has to be provided in Stage coordinates.
me (a StyledPicker)
x
y
[with part]
[with tracking]
Page 768
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s i z e o f S t y l e d P i c k e r
size of StyledPicker
size me
with how
with physical
When the how keyword of this handler is passed 'items', it returns the number of items
visible at one time in the Picker. Otherwise the inherited actor's size handler is called.
me (a StyledPicker)
[with how]
[with physical]
SwatchRenderer
(an ImageRenderer)
This is a renderer which is designed to display actor snapshots nicely. It firsts paints the region with
it's backgroundRenderer. It then draws it's media scaling it to the proportions described in it's size
property. Finally it draws text , if that property has been set and the object it is drawing into has no text,
at the bottom.
Note that this is designed to act like a standard imageRenderer and the user can call
capturePicture to get a snapshot of an actor.
Properties of SwatchRenderer
Actor of SwatchRenderer
This is set by capturePicture to specify whose snapshot has been taken.
Getter
get the Actor of me
Setter
set the actor of me
to NewValue
Page 769
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
M e d i a o f S w a t c h R e n d e r e r
Media of SwatchRenderer
This points to the pixelMap object storing the snapshot of the actor.
Getter
get the Media of me
me (a SwatchRenderer)
Setter
set the media of me
to NewValue
me (a SwatchRenderer)
to
size of SwatchRenderer
This specifies the dimesions of the snapshot. This is calculated automatically by
capturePicture .
Getter
get the size of me
Setter
set the size of me
to NewValue
Text of SwatchRenderer
This specifies what text, if any is to be drawn underneath the snapshot. By default,
capturePicture sets this to be the objectstring of the actor.
Getter
get the Text of me
Setter
set the text of me
to NewValue
Page 770
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h a n d l e r s o f S y m b o l
Symbol
(an Object)
The usefulness of symbols is that they are uniquely identifiable by name. Two symbols with the same
name are guaranteed to be the same object .
Symbol literals are simply a pair of double-quote (' ) characters surrounding a non-empty sequence of
characters (which cannot include the single-quote character).
Symbols are not case sensitive. That is, 'Bebop' and 'bebop' and 'BEBOP' all indicate the same
symbol. However, the case of symbols is remembered from the first time the symbol in entered; this case
is used when the symbol is written.
Handlers of Symbol
handlers of Symbol
handlers me
with name
with inherited
with local
This returns a list of all handlers defined under the given name, i.e. the implementors of
that handler name.
Note: This is identical in behavior to implementors of Symbol .◆
me (a Symbol)
See Also
implementors
implementors of Symbol
implementors me
This returns a list of all handlers defined under the given name, i.e. the implementors of
that handler name.
Note: This is identical in behavior to handlers of Symbol .◆
me (a Symbol)
Page 771
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
n a m e o f S y m b o l
See Also
handlers
name of Symbol
name me
This returns the string representing the given symbol's name.
me (a Symbol)
System
(an Object)
The System object provides access to information about your system environment and the ability to
modify the environment when possible.
System receives two events from the operating system environment: suspend and resume. These events
may be shadowed by you via the eventListeners property of System.
Example
Page 772
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
C l o c k o f S y s t e m
Properties of System
Clock of System
This is the system clock, which is tied to one (or the only) clock of the native system. You
may or maynot want to use this for your own purposes.
Getter
get the Clock of me
Setter
set the clock of me
to NewValue
Page 773
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c u r r e n t c o m m a n d k e y o f S y s t e m
See Also
currentcommandkey of System
The currentCommandKey property contains the object that will get keyDown events that
are generated when the command key is simultaneously depressed with another key.
When the user presses a key while holding down the command key, the resultant
keyDown event is sent to the object in the currentCommandKey property of the system.
Setting the currentCommandKey to False will prevent the keyDown event from being
sent when the command key is depressed. Typically, the currentCommandKey object will
be a MenuBarActor in some active toplevel actor. The toplevel actors are responsible for
setting and removing targets from the currentCommandKey property of the System object.
The currentCommandKey can be set to specify any type of object, e.g., a Menubar. In the
Macintosh user interface, shortcuts to selecting menu items are often available by pressing
a command-key combination. For example, in most Macintosh word processors, you can
copy a selection of text either by selecting 'Copy' off the edit menu or by holding down the
command key and pressing 'C'.
If the menu bar object includes scripts that can process menu selections as well as their
command-key shortcuts, designating the menu bar object through the
currentCommandKey property will cause the command-key events to be correctly
processed.
Note: Form
get the System's currentCommandKey
set the System's currentCommandKey to Actor◆
Getter
get the currentCommandKey of me
Setter
set the currentcommandkey of me
to NewValue
Example
set the System's currentCommandKey to myWindow
set the System's currentCommandKey to false
Page 774
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c u r r e n t d i r e c t o r y o f S y s t e m
currentdirectory of System
The currentDirectory is a property of the System. It is a Pathname naming a directory that
is used as a default for relative Pathnames -- Pathnames without a top level directory
reference (or syntactically, a Pathname beginning with a colon).
Absolute pathname: “Socrates:Stuff:Folder:myfile”
Relative pathname: “:Folder:myfile”
If the currentDirectory is “Socrates:Stuff:”, the above relative Pathname will reference the
same file as the above absolute Pathname.
Returns the current directory of the System as a Pathname object.
Sets the currentDirectory of the System to a new Pathname.
Default = False unless set by specifying a directory when selecting a project to create or
open.
Getter
get the currentDirectory of me
Setter
set the currentdirectory of me
to NewValue
Use this to change the current directory used in file and directory operations.
me (a System)
to
Example
currentDirectory
get the currentDirectory of System
set the currentDirectory of System to “string”
set the currentDirectory of System to Pathname
See Also
eventlisteners of System
This is a list of objects to which the System object will send events it receives via the
systemEvent message.
Page 775
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b e s t c o l o r d e p t h o f S y s t e m
Getter
get the eventListeners of me
Setter
set the eventlisteners of me
to NewValue
See Also
See systemEvent
Handlers of System
bestcolordepth of System
bestColorDepth me
Returns the best color depth provided in the current system environment. This is the
number of pixels of the monitor with the greatest graphics support. (This may not be the
greatest depth that the monitors can support: it is just their current depth settings.)
me (a System)
See Also
See maxColorDepth
fonts of System
fonts me
Returns a list of Font objects. These are the fonts supported by your current system
environment.
me (a System)
Example
To get a list of strings with all of the names of the fonts in the system:
get the name of everything in the fonts of the system
get the fonts of System
Page 776
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
k e y b o a r d s o f S y s t e m
keyboards of System
keyboards me
Returns a list of all Keyboard objects representing the keyboards currently available to the
system.
me (a System)
Example
get the keyboards of the System
mainmonitor of System
mainMonitor me
Returns the main monitor of the system. The concept of "main monitor" is
system-dependent and may or may not be supported by a particular system.
Note: In the Macintosh, the main monitor is the one with the Macintosh menubar.◆
me (a System)
See Also
maxcolordepth of System
maxColorDepth me
Returns the maximum depth (in pixels) of the deepest monitors currently available to the
system.
me (a System)
Example
get the maxColorDepth of the System
See Also
See bestColorDepth
Page 777
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o n i t o r s o f S y s t e m
monitors of System
monitors me
Returns a list of Monitor objects representing the monitors currently available to the
system.
me (a System)
Example
get the monitors of the System
See Also
name of System
name me
Returns the name of the local system. This is a system-dependent name.
Note: On a Macintosh, it returns the "Macintosh Name" as set in the File Sharing control
panel◆
me (a System)
See Also
processor of System
processor me
Returns the ID of the processor currently running the system environment. This is a
system-dependent identifier.
Note: In the Macintosh, this is a number identifying the type of 68XXX processor.◆
me (a System)
Example
if the system's processor = 68060 then sendToLog "Big Time!"
get the processor of the System
Page 778
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e s u m e o f S y s t e m
resume of System
resume me
The resume event is sent to the system object whenever the SK8 process resumes
execution.
me (a System)
storagedevices of System
storageDevices me
me (a System)
suspend of System
suspend me
The suspend event is sent to the System object whenever the user switches out of SK8 into
another Macintosh application (such as the Finder). The default suspend handler does
nothing.
me (a System)
textstyles of System
textStyles me
Returns a list of style objects. This is a list of the text styles supported by the current
system environment.
me (a System)
Example
get the textStyles of System
version of System
version me
Returns the version of the native operating system.
me (a System)
Page 779
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
v e r s i o n o f S y s t e m
Example
In a Macintosh with System 7.1.1, "version of System" will return "7.1.1".
get the version of the System
See Also
SystemClock
(a Clock)
SystemClock is the only clock in SK8 that is directly updated by the SK8 system. It has no master and
automatically updates as quickly as possible, subject to the limitations of the hardware and the SK8
system.
The SystemClock is the fastest clock in the system. Any clock that needs to be ticked as quickly as
possible should be a slave of the SystemClock .
The SystemClock can be ticked by you by calling the function tickEventClock .
Note: like the Stage and the System objects the SystemClock cannot be instantiated.◆
Example
As noted above the fastest possible clock you can create is a direct slave of the SystemClock . This clock
should be a child of SlaveClock and have its masterTicksPerTick property set to 1. This means
that each time the SystemClock ticks, our clock will be ticked.
new SlaveClock with objectName "TheFastestClock"
set the masterTicksPerTick of TheFastestClock to 1
And all that remains is to start the clock and define a suitable tick handler to allow us to do
something useful when the clock is ticked.
See Also
the function tickEventClock .
SystemError
(an Error)
Page 780
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
v e r s i o n o f S y s t e m
See Also
The Condition System section of the User Guide's SK8Script Language chapter
Table
(a Collection)
A Table object can store and retrieve objects indexed with a key. Unlike a List or Array, a Table has
no understanding of the ordering of the objects so, although keys can still be numeric, such a key does
not necessarily have any bearing on the position of an item in the table.
Also unlike a List or Array, when an item corresponding to a non-existent key is set, a Table will add
that item to itself under the new key. That is, when setting an item, a table will either overwrite the data
in the existing entry under the given key, or if there was no entry, create and add a new entry for the data
under the given key.
Table objects obey the collection protocol, so they can be used in iterative constructs. The order of the
items in a table is nondeterminisitic.
Note: The special “type” TablePair can be used to access key-data pairs in a table as ListPair s, as in
TablePair x in someTable or every TablePair in someTable .◆
A faster but less generalized form of table, this uses the same object operator when testing whether a
key is matched.
TypeTable :
Uses the is a operator when testing whether a key is matched. In other words, it is keyed on
type-conformace of a given object to the key object — i.e. an object matches the key that is its nearest
ancestor (or itself).
Note: When setting an item corresponding to a given key, TypeTable uses the same object operator
(rather than is a ) to find the key (or determine that it needs to be added).◆
See Also
ObjectTable , TypeTable , TablePair
Page 781
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d a t a o f Ta b l e
Properties of Table
data of Table
This property holds the internal representation of the table's data. It should not normally
need to be accessed directly.
Getter
get the data of me
Setter
set the data of me
to NewValue
TablePair
(a ListPair)
TablePair is a special “type” that exists solely for the purpose of accessing key-data pairs in a table as
ListPair s.
Example
set t to a new Table
set item 'Bob' in t to 1
set item "blah blah" in t to 2
get every item in t -- returns {2, 1} (note that the order may vary)
get every TablePair in t -- returns {{"blah blah" . 2}, {'Bob' . 1}}
TablePicker
(a Rectangle)
This is a two-dimensional picker for displaying sets of text and renderers. It follows the same basic API
as the regular picker. It has an items property, a selecteditems property, a
selectioncompleted handler. It is different in that the items property accepts an array of items
Page 782
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o l u m n L i n e s S i z e o f Ta b l e P i c k e r
rather than a list of items. (Actually, as a convenience, if you set the items to a list of lists, it will
construct an array for you by setting the items of each row to each list.) There are properties like Rows ,
Columns , and Dimensions to let you manipulate this array.
The selected items are stored in the array stored in the selectionArray property. When items are
displayed, first createDisplayItem is called on each item. By default, this leaves renderers alone and
calls createTextDisplayItem on the item to create a string. These display items are stored in an array
stored in the imageArray property.
The picker gives you control over the sizes of individual rows and columns. There are two properties,
rowHeights and columnWidths which contain a list of integers which are the sizes of each individual
row and column. By default, the picker will scale the sizes of its rows and columns to fit the size of the
text (or renderer ) inside of it (augmented by the properties minHeight and minWidth which
prevent any item from being below their values). These are computed by the handlers
recomputeColumnWidths and recomputeRowHeights . You can override these values either by
redefining these handlers or setting the properties manually. For convenience if you set the rowHeights
or columnWidths to a single integer (rather than a list) it will make every row or column that
consistent size.
In terms of Highlighting the selected items, by default it paints the item in the system's hilighting color.
You can turn this on and off with the highlightSelection property. In addition, you can hilight items
with a highlightColor and then set the size of the hilight with the selectionBorder property
(which takes a number which is the inset size of the hilighting halo).
See Also
columnLinesSize , rowLinesSize
Properties of TablePicker
columnLinesSize of TablePicker
This is the width of the vertical lines which are drawn between columns. If this is set to
zero, then no vertical lines will be drawn.
Getter
get the columnLinesSize of me
Setter
set the columnlinessize of me
to NewValue
Page 783
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o l u m n s o f Ta b l e P i c k e r
Example
set columnLinesSize to 1
columns of TablePicker
This returns the number of columns in the table picker. Note that setting this can be a
destructive operation if the array is shrunk.
Getter
get the columns of me
Setter
set the columns of me
to NewValue
columnSpacing of TablePicker
This is the default spacing between columns.
Getter
get the columnSpacing of me
Setter
set the columnspacing of me
with relative
to NewValue
me (a TablePicker)
[with relative]
to
columnsRigid of TablePicker
When this property is set to True , columnWidths will not be recomputed every time the
items are set.
Getter
get the columnsRigid of me
Page 784
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o l u m n W i d t h s o f Ta b l e P i c k e r
Setter
set the columnsrigid of me
to NewValue
columnWidths of TablePicker
This stores a list of integers which specify the widths for each of the columns. Note that
when calling the setter, you can specify a single integer, and a list will be created so that
every column will be set to that size.
Getter
get the columnWidths of me
Setter
set the columnwidths of me
to NewValue
me (a TablePicker)
to
createTextColors of TablePicker
When this property is set to True , the CreateTextColor handler will be used each time
the tablePicker's items are set to create a different textcolor for each item.
Getter
get the createTextColors of me
Setter
set the createtextcolors of me
to NewValue
createTextStyles of TablePicker
When this property is set to True , the createTextStyle handler will be used each time
the tablePicker's items are set to create a different textstyle for each item.
Getter
get the createTextStyles of me
Page 785
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d i m e n s i o n s o f Ta b l e P i c k e r
Setter
set the createtextstyles of me
to NewValue
dimensions of TablePicker
Getter
get the dimensions of me
This returns the dimensions of the table picker. Note that setting this can be a destructive
operation if the array is shrunk.
me (a TablePicker)
Setter
set the dimensions of me
to NewValue
me (a TablePicker)
to
editorIncluded of TablePicker
Getter
get the editorIncluded of me
me (a TablePicker)
Setter
set the editorincluded of me
to NewValue
me (a TablePicker)
to
Page 786
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 Ta b l e P i c k e r
highlightColor of TablePicker
This is a renderer which specifies the color of the which frame selecteditems . Note the
size of this frame is specified by selectionBorder.
Getter
get the highlightColor of me
Setter
set the highlightcolor of me
to NewValue
highlightSelection of TablePicker
If this property is True , a frame the size of selectionBorder is painted around the
selected items in the highlightColor.
Getter
get the highlightSelection of me
Setter
set the highlightselection of me
to NewValue
horizontalScroll of TablePicker
This is the number of items over horizontally that the tablePicker is displaying. Note that
this overrides the default style of scrolling.
Getter
get the horizontalScroll of me
Setter
set the horizontalscroll of me
with relative
to NewValue
me (a TablePicker)
[with relative]
to
Page 787
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i m a g e A r r a y o f Ta b l e P i c k e r
imageArray of TablePicker
This is the array which stores the strings and renderers which are drawn in the
tablepicker. It is imperative that this array be of the same size as the item's array.
Making sure that these stay in synch is handled by the items property.
Getter
get the imageArray of me
Setter
set the imagearray of me
to NewValue
me (a TablePicker)
to
items of TablePicker
This property stores the array of items of the tablepicker. Note that although the property
always contains an array, as a convenience, you can set this property to a list of lists to
specify the items. This list of lists is converted into an array where each sublist is assigned
a row. For example, if you set the items of my tablepicker to {the
knownchildren of rgbcolor, the knownchildren of actor} , the tablepicker
will have two rows. The first row will display all the colors, the second row will display
the names of the actors.
Getter
get the items of me
Setter
set the items of me
to NewValue
Note that after the items property is set, by default the imageArray property and the
selectionArray property are set with an array of corresponding dimensions. This is
done by calling SetupSelectionArray and SetUpImages .
me (a TablePicker)
to
Page 788
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l a s t s e l e c t e d o f Ta b l e P i c k e r
lastselected of TablePicker
This property is used to make the doubleclick of the tablepicker only work if a
particular cell has been double clicked.
Getter
get the lastSelected of me
Setter
set the lastselected of me
to NewValue
lastselection of TablePicker
This property is used to make the last tuple that was selected. It is used to make multiple
selection behave in the standard style found in spread sheets.
Getter
get the lastSelection of me
Setter
set the lastselection of me
to NewValue
me (a TablePicker)
to
linecolor of TablePicker
This is the RGBColor used when drawing the lines which divide up the tablepicker into
rows and columns.
Getter
get the lineColor of me
Setter
set the linecolor of me
to NewValue
Page 789
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l i n e S p a c i n g o f Ta b l e P i c k e r
See Also
columnlinessize , rowlinessize
lineSpacing of TablePicker
Getter
get the lineSpacing of me
This actually just gets or sets the rowspacing of the tablepicker. It is provided for
consistency to users of the regular picker
me (a TablePicker)
Setter
set the linespacing of me
to NewValue
me (a TablePicker)
to
minHeight of TablePicker
This specifies the minimum height for a cell. See computeRowHeights for more details.
Getter
get the minHeight of me
Setter
set the minheight of me
to NewValue
minWidth of TablePicker
This specifies the minimum Width for a cell. See computeColumnWidths for more
details.
Getter
get the minWidth of me
Page 790
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p a r t n e r H S c r o l l e r o f Ta b l e P i c k e r
Setter
set the minwidth of me
to NewValue
partnerHScroller of TablePicker
The companion horizontal scroller associated with the tablePicker.
Getter
get the partnerHScroller of me
Setter
set the partnerhscroller of me
to NewValue
me (a TablePicker)
to
partnerVScroller of TablePicker
The companion vertical scroller associated with the tablePicker.
Getter
get the partnerVScroller of me
Setter
set the partnervscroller of me
to NewValue
me (a TablePicker)
to
rowHeights of TablePicker
This stores a list of integers which specify the heights for each of the rows. Note that
when calling the setter, you can specify a single integer, and a list will be created so that
every row will be set to that size.
Getter
get the rowHeights of me
Page 791
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r o w L i n e s S i z e o f Ta b l e P i c k e r
Setter
set the rowheights of me
to NewValue
me (a TablePicker)
to
rowLinesSize of TablePicker
This is the width of the horizontal lines which are drawn between rows. If this is set to
zero, then no lines will be drawn.
Getter
get the rowLinesSize of me
Setter
set the rowlinessize of me
to NewValue
rows of TablePicker
This returns the number of rows in the table picker. Note that setting this can be a
destructive operation if the array is shrunk.
Getter
get the rows of me
Setter
set the rows of me
to NewValue
rowSpacing of TablePicker
This is the default spacing between rows. It is analagous to lineSpacing of picker.
Getter
get the rowSpacing of me
Page 792
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r o w s R i g i d o f Ta b l e P i c k e r
Setter
set the rowspacing of me
with relative
to NewValue
me (a TablePicker)
[with relative]
to
rowsRigid of TablePicker
When this property is set to True , rowHeights will not be recomputed every time the
items are set.
Getter
get the rowsRigid of me
Setter
set the rowsrigid of me
to NewValue
scale of TablePicker
Setter
set the scale of me
to NewValue
me (a TablePicker)
to
selectByRows of TablePicker
Getter
get the selectByRows of me
Page 793
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e l e c t i o n A r r a y o f Ta b l e P i c k e r
me (a TablePicker)
Setter
set the selectbyrows of me
to NewValue
me (a TablePicker)
to
selectionArray of TablePicker
This is the array which stores which items are selected in the tablePicker Each cell in the
array can be True or False to indicate if the item is selected or not. It is imperative that
this array be of the same size as the item's array. This is handled by the standard items
property.
Getter
get the selectionArray of me
Setter
set the selectionarray of me
to NewValue
me (a TablePicker)
to
selectionBorder of TablePicker
This specifies the number of pixels wide and high that the border of the selected item
takes up. It is specified in the form of {width, height} where width and height are integers.
Getter
get the selectionBorder of me
Setter
set the selectionborder of me
to NewValue
Page 794
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 Ta b l e P i c k e r
selectionStyle of TablePicker
selection style can for a TablePicker be either 'multiple' or 'single'
Getter
get the selectionStyle of me
Setter
set the selectionstyle of me
to NewValue
me (a TablePicker)
to
tableHOffset of TablePicker
This the number of pixels the table picker is offset to the right when the horizontal scroll
is 0.
Getter
get the tableHOffset of me
Setter
set the tablehoffset of me
to NewValue
tableVOffset of TablePicker
This the number of pixels the table picker is shifted down when the vertical scroll is 0.
Getter
get the tableVOffset of me
Setter
set the tablevoffset of me
to NewValue
Page 795
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t e x t C o l o r s o f Ta b l e P i c k e r
textColors of TablePicker
This is the array which stores the textcolor of each of the items in the picker. Each cell
in the array can be an rgbcolor. It is imperative that this array be of the same size as the
item's array. This is handled by the standard items property.
Getter
get the textColors of me
Setter
set the textcolors of me
to NewValue
textStyles of TablePicker
This is the array which stores the textstyle of each of the items in the picker. Each cell
in the array can be a style list. It is imperative that this array be of the same size as the
item's array. This is handled by the standard items property.
Getter
get the textStyles of me
Setter
set the textstyles of me
to NewValue
verticalscroll of TablePicker
This is the number of items over vertically that the tablePicker is displaying. Note that
this overrides the default style of scrolling.
Getter
get the verticalScroll of me
Setter
set the verticalscroll of me
with relative
to NewValue
Page 796
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a l i g n S e l e c t i o n o f Ta b l e P i c k e r
me (a TablePicker)
[with relative]
to
Handlers of TablePicker
alignSelection of TablePicker
alignSelection me
with alignment
This can be called to compute and set the horizontal and vertical scroll of the table picker
so that the selecteditems appear in a given place on the screen. There is an alignment
keyword which specifies where the selecteditems should show.
Valid alignments are: False, 'top', 'topleft', 'topright', 'topcenter',
'center', 'leftcenter', 'rightcenter', 'bottom', 'bottomleft',
'bottomright', 'bottomcenter', 'left', or 'right' .
me (a TablePicker)
[with alignment]
clearSelection of TablePicker
clearSelection me
with redraw
This deselects every item in the TablePicker.
me (a TablePicker)
computeColumnWidths of TablePicker
computeColumnWidths me
Compute minimal values for column widths. Called when items are set and the columns
are not rigid. It does this by looking at each item and, if it is a string it uses the width of
the string. If it is a renderer, it uses the value in the minWidth property.
me (a TablePicker)
Page 797
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o m p u t e R o w H e i g h t s o f Ta b l e P i c k e r
See Also
columnsRigid , columnWidths
computeRowHeights of TablePicker
computeRowHeights me
Compute minimal values for row heights. Called when items are set and the rows are not
rigid. It does this by looking at each item and, if it is a string it uses the height of the
string. If it is a renderer, it uses the value in the minHeight property.
me (a TablePicker)
See Also
rowRigid , rowWidths
createDisplayItem of TablePicker
createDisplayItem me, theitem
The table picker can show either renderers or text. However, the user may wish to have a
table picker which has renderers as it's items, but have these renderers appear as text.
This is the function which handles that. This handler is called on every item whenever
the items property is set. By default, it checks if the item is a renderer or not. If it is, then
the renderer is stored in the imageArray. Otherwise, it calls createTextDisplayItem
on the item.
me (a TablePicker)
theitem
Example
The following handler would ensure that every item appears as text.
on createDisplayItem (me (a superTablePicker), theItem)
---ignore what it is and always get it's text...
createTextDisplayItem(me, theItem)
end createDisplayItem
createtextcolor of TablePicker
createTextColor me, itemlocation
Page 798
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c r e a t e Te x t D i s p l a y I t e m o f Ta b l e P i c k e r
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 (a TablePicker)
itemlocation
createTextDisplayItem of TablePicker
createTextDisplayItem me, theobject
As with a regular picker, this handler is called every time that the items of the tablepicker
are set or changed to generate the corresponding strings for an item. By default, this
returns the null string, (i.e. ""), if the item is False , else it gets the objectString for the
item.
me (a TablePicker)
theobject
See Also
createDisplayItem
createTextStyle of TablePicker
createTextStyle me, itemlocation
This handler is used to generate the set of styles 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 style list (e.g. {'bold', 'italic'} ) in the same
form as a normal textStyle .
me (a TablePicker)
itemlocation
element of TablePicker
element me, item
This handler takes a tuple as a second argument and returns the item of me (a
TablePicker) at those coordinates. An item can be set in the same way.
me (a TablePicker)
item
Page 799
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e l e m e n t s o f Ta b l e P i c k e r
Example
set the element of (bogusTablePicker, {1,2}) to black
elements of TablePicker
elements me
This returns the number of elements in me (a tablePicker)
me (a TablePicker)
extendedMouseDown of TablePicker
extendedMouseDown me
If the user mouses down on a particular item for a period of time, an
ExtendedMouseDown message is sent by mousedown to the tablepicker. If the
extendedMouseDown returns False (the default), then mousedown continues normally.
Otherwise it exits.
me (a TablePicker)
fillSelection of TablePicker
fillSelection me, val
This takes a value as the second argument and sets every item in the selectionArray to
this value. For example, to deselect every item, call this handler with False . To select
every time, call this handler with True .
me (a TablePicker)
val
flashItem of TablePicker
flashItem me
This handler flashes the item returned by GetItemPosition , i.e. the item that the mouse
is over. It does so using drawXORRectangle .
me (a TablePicker)
Page 800
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
fl a s h L i n e o f Ta b l e P i c k e r
flashLine of TablePicker
flashLine me
with orientation
This handler flashes an XOR line below the item returned by GetLinePosition , i.e. the
item that the mouse is over.
me (a TablePicker)
[with orientation]
See Also
drawXORRectangle .
getLinePosition of TablePicker
getLinePosition me
GetLinePosition returns the column and row position of the item of me (a TablePicker)
under the mouse. If no items are under the mouse, return {0, <number of rows of
me>} .
me (a TablePicker)
height of TablePicker
height me
with how
This acts like the standard height property unless the 'how' keyword is called with the
value 'items' or 'partialitems'. In this case of 'items', it returns the number of rows which
are completely visible. In this case of 'partialitems', it returns the number of rows which
are at least partially visible.
This property can be set with the 'how' keyword set to 'items' to specify that you want the
tablepicker just tall enough to include the number of items specified.
me (a TablePicker)
[with how]
initialize of TablePicker
initialize me, original, isnew, initargs
Page 801
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i t e m B o u n d s R e c t o f Ta b l e P i c k e r
This calls the inherited handler and then resets the properties. In particular, it duplicates
the various arrays.
me (a TablePicker)
original
child
args
itemBoundsRect of TablePicker
itemBoundsRect me, tuple
with physical
Returns a list specifying the {left, top, right, bottom} coordinates of the cell
indexed at the given {column, row} tuple. Note that like boundsrect it takes a
'physical' keyword.
me (a TablePicker)
tuple: Indices in the form of {h, v} which specify the desired item.
[with physical]
itemVisible of TablePicker
itemVisible me, tuple
with how
This function takes a tuple as a second argument and returns True if this element can be
seen based on the current horizontalScroll and verticalScroll .
me (a TablePicker)
tuple: Indices in the form of {h, v} which specify the desired item.
[with how]
keyDown of TablePicker
keyDown me, thechar
This handler supports the standard spreadsheet behaviors of arrow key navigation and
shift key selection.
me (a TablePicker)
thechar
Page 802
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
k e y U p o f Ta b l e P i c k e r
keyUp of TablePicker
keyUp me, thechar
Calls the inherited handler than calls selectionCompleted .
me (a TablePicker)
thechar
mapitems of TablePicker
mapItems me, function
with return
with selected
with setting
This handler applies thie function to each element in the the tablePicker
me (a TablePicker)
function: This argument specifies the function to be applied to the elements.
[with return]: If the 'return' keyword is True , then a list of the values
returned by the function is returned.
[with selected]: If the 'selected' keyword is set to True then it applies the
function only to selected items.
[with setting]: If the setting keyword is True (the default), then the items in
the table picker are set to the result of the function.
mouseDown of TablePicker
mouseDown me
The standard mousedown behavior does the standard maclike spread sheet behavior in
terms of selecting, scrolling, and multiple selection. In addition if the user mouses down
on a particular item for a period of time, this mousedown sends an ExtendedMouseDown
message to the tablepicker. If the extendedMouseDown returns False (the default),
then mousedown continues normally. Otherwise it exits.
me (a TablePicker)
mouseUp of TablePicker
mouseUp me
This is redefined to handle the click and double click behavior. Click and double click will
be sent only if the mousedowns and mouseups occur on the same cell.
Page 803
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 Ta b l e P i c k e r
me (a TablePicker)
partnerScroller of TablePicker
partnerScroller me, orientation
This property is used to specify either of two Scrollers (horizontal or vertical) that can
control me (a TablePicker).
me (a TablePicker)
orientation: This may be 'horizontal' or 'vertical'.
pointOnWhichPart of TablePicker
pointOnWhichPart me, h, v
with part
with tracking
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.
me (a TablePicker)
h
v
[with part]
[with tracking]
recomputeSizes of TablePicker
recomputeSizes me
This calls computeRowHeights and computeColumnWidths .
me (a TablePicker)
resized of TablePicker
resized me
This makes sure that any attached scrollers are updated.
me (a TablePicker)
Page 804
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e l e c t A l l o f Ta b l e P i c k e r
selectAll of TablePicker
selectAll me
Select all the elements in TablePicker.
me (a TablePicker)
selectedItem of TablePicker
selectedItem me
This property is a shorthand for getting and setting the first selected item in the table
picker.
me (a TablePicker)
selectedItems of TablePicker
selectedItems me
This property can access and set the list of the selected objects of the table picker. Note
that this list is provided as a convenient interface for dealing with the selectionArray
which is the data structure which actually stores what is selected.
me (a TablePicker)
selection of TablePicker
selection me
This property can access and set the list of tuples (i.e. a list of two integers specifying an
index) of the selected items of the table picker. Note that this list is provided as a
convenient interface for dealing with the selectionArray which is the data structure
which actually stores what is selected.
me (a TablePicker)
selectionCompleted of TablePicker
selectionCompleted me
The selectionCompleted handler is called when the system determines that the selection
process is complete. The idea is to let the tablePicker know that the selection has changed
because it might want to perform some action at this point. The selection is considered
Page 805
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e t u p I m a g e s o f Ta b l e P i c k e r
complete when the user releases the mouse or a key (that is, the default tablePicker
mouseUp and keyUp handlers call this handler).
me (a TablePicker)
setupImages of TablePicker
setupImages me
This is called whenever items are set to setup the imageArray. The default is to create an
array of the appropriate size and fill it in by calling CreateDisplayItem for each item.
me (a TablePicker)
setupItems of TablePicker
setupItems me
with dimensions
This is called whenever items are set to initialize the items array. The default is to create
an array of the appropriate size.
me (a TablePicker)
[with dimensions]
setupSelectionArray of TablePicker
setupSelectionArray me
with dimensions
This is called whenever items are set to setup the selectionArray. The default is to
create an array of the appropriate size and fill it in with False .
me (a TablePicker)
[with dimensions]
setupTextColors of TablePicker
setupTextColors me
with dimensions
Whenever the items property is set, it calls this handler to setup the array 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 this array.
Page 806
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e t u p Te x t S t y l e s o f Ta b l e P i c k e r
me (a TablePicker)
[with dimensions]
setupTextStyles of TablePicker
setupTextStyles me
with dimensions
Whenever the items property is set, it calls this handler to setup the array stored in the
textStyles property. By default, this function checks if createTextStyles is set to
True , and if so calls CreateTextStyle on each item to construct this array.
me (a TablePicker)
[with dimensions]
size of TablePicker
size me
with how
This acts like the standard size property unless the 'how' keyword is called with the
value 'items' or 'partialitems'. In this case of 'items', it returns the number of rows and
columns which are completely visible. In this case of 'partialitems', it returns the number
of rows and columns which are at least partially visible.
This property can be set with the 'how' keyword set to 'items' to specify that you want the
tablepicker just wide enough to include the number of items specified.
me (a TablePicker)
[with how]: This can be False , 'items' , or 'partialItems'
Text of TablePicker
Text me
with item
This acts like the standard text property unless the 'item' keyword is called with a tuple
specifying an index. In this case, the text of that item is returned. This property can be set
with in the same way to set the text of a specific item.
me (a TablePicker)
[with item]
Page 807
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
u p d a t e Ta b l e P i c k e r o f Ta b l e P i c k e r
updateTablePicker of TablePicker
updateTablePicker me
This handler forces the table picker to completely update itself to match the current
items array. It does this by recomputing the imageArray, the SelectionArray, the
TextStyles , and the TextColors .
me (a TablePicker)
width of TablePicker
width me
with how
This acts like the standard width property unless the 'how' keyword is called with the
value 'items' or 'partialitems'. In this case of 'items', it returns the number of columns
which are completely visible. In this case of 'partialitems', it returns the number of
columns which are at least partially visible.
This property can be set with the 'how' keyword set to 'items' to specify that you want the
tablepicker just wide enough to include the number of items specified.
me (a TablePicker)
[with how]
TablePickerEditor
(an EditText)
This is the prototype editor which appears in a table picker when it's editorIncluded property has
been set to True . This means that it has TablePickerEditorAddOn as an additional parent. See
there for more details.
Properties of TablePickerEditor
edititem of TablePickerEditor
This is set to the tuple which is the postion in the array of the item being edited.
Page 808
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d e a c t i v a t e t e x t o f Ta b l e P i c k e r E d i t o r
Getter
get the editItem of me
Setter
set the edititem of me
to NewValue
Handlers of TablePickerEditor
deactivatetext of TablePickerEditor
deactivateText me
Call inherited handler, then make me (a TablePickerEditor) disappear by moving me
offstage.
me (a TablePickerEditor)
keydown of TablePickerEditor
keyDown me, thechar
By default, this textfield will type normally until the user types either an escape, return or
enter. If the user types a escape, then the editor will be moved offstage and the
EscapeAction message will be sent to the tablepicker. If the user types a return or
enter, then the editor will be moved offstage and the returnAction message will be sent
to the tablepicker.
me (a TablePickerEditor)
thechar
TablePickerEditorAddOn
(an Object)
This is an abstract object which is designed to be mixed into to a tablePicker. There is a virtual
property called editorIncluded which can be set to True or False to add or remove this as a parent
Page 809
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e d i t o r o f Ta b l e P i c k e r E d i t o r A d d O n
to a table picker. This object provides in-place editing functionality for the table picker. It adds a text
editor to the picker which can be overlayed a given cell or cells. This cell can be typed into to provide
new information for the cell (or any other purpose). The functionality can be accessed using the handlers
defined below.
This is useful for making spreadsheet type objects. For example, if you wish to allow the user to select a
cell and type in place, this functionality would provide you with the structure to do so.
See the TablePickerEditor object for more information. Note that you can redefine the behavior of
both the tablepicker and this editor to achieve the results you want.
Properties of TablePickerEditorAddOn
editor of TablePickerEditorAddOn
This property tags the editor which is included in the TablePicker that we have been
mixed into.
Getter
get the editor of me
Setter
set the editor of me
to NewValue
Handlers of TablePickerEditorAddOn
displayEditor of TablePickerEditorAddOn
displayEditor me
with indices
with defaulttext
with selectedtext
This handler is used to display the editor window of me (a TablePicker)
Page 810
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e s c a p e A c t i o n o f Ta b l e P i c k e r E d i t o r A d d O n
me (a TablePickerEditorAddOn)
[with indices]
[with defaulttext]
[with selectedtext]
escapeAction of TablePickerEditorAddOn
escapeAction me
When the user types the escape key in the editor, the editor is moved offscreen and this
handler is called. The default is to do nothing.
me (a TablePickerEditorAddOn)
initialize of TablePickerEditorAddOn
initialize me, original, isnew, initargs
This handler calls the default initialize and then insures that the new text editor is in place
and functional.
me (a TablePickerEditorAddOn)
original
child
args
returnAction of TablePickerEditorAddOn
returnAction me, stringvalue, indices
When the user types the return or enter key in the editor, the editor is moved offscreen
and this handler is called. The default is to reset the keytarget to the editor.
me (a TablePickerEditorAddOn)
stringvalue
indices
tbSketchRenderer
(a SketchRenderer)
Page 811
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s t a r t p o i n t o f T b S k e t c h R e n d e r e r
A special case of the SketchRenderer. The TbSketchRenderer plots all its lines from the same point
which is stored in the startPoint property.
Because of this, the linePoints property now holds a list in which each item is a list of two integers
(specifying the endpoints of the line). The following settings, for example, would draw two lines:
startpoint : {10,10}
See Also
startPoint and linePoints .
Properties of tbSketchRenderer
startpoint of TbSketchRenderer
Specifies the startPoint of every line this renderer draws. When rendering, we run
through the linePoints and plot a line from the startPoint to each pair of numbers
in the list.
Getter
get the startPoint of me
me (a TbSketchRenderer)
Setter
set the startpoint of me
to NewValue
me (a TbSketchRenderer)
to: A point, specified as a list of two integers of the form {h,v}.
Handlers of tbSketchRenderer
render of TbSketchRenderer
render me, theactor, region, thepaper
Page 812
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o l l e c t i o n s t r u c t u r e s h a r e d o f Te x t
Paints the backgroundRenderer and then draws all the lines on it using the RGBColor
specified in the foreGroundRenderer property. All lines are drawn from the
startPoint .
me (a TbSketchRenderer)
theactor (an Actor): The actor to be rendered.
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.
See Also
Text
(a Collection)
Handlers of Text
collectionstructureshared of Text
collectionStructureShared me, supercollection
me (a Text)
supercollection
currentitem of Text
currentItem me, state
me (a Text)
state
Page 813
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e m p t y o f Te x t
empty of Text
empty me
me (a Text)
finalstate of Text
finalState me
me (a Text)
finalstatetyped of Text
finalStateTyped me, type
me (a Text)
type
initialstate of Text
initialState me
me (a Text)
initialstatetyped of Text
initialStateTyped me, type
me (a Text)
type
mapcharacters of Text
mapCharacters me, fromindex, toindex, functionorname
me (a Text)
fromindex
toindex
functionorname
Page 814
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a p i t e m s o f Te x t
mapitems of Text
mapItems me, fromState, toState, functionorname
me (a Text)
fromstate
tostate
functionorname
mapitemstyped of Text
mapItemsTyped me, type, fromState, toState, functionorname
me (a Text)
type
fromstate
tostate
functionorname
maplinechunks of Text
mapLineChunks me, rangestart, rangeend, functionorname
me (a Text)
rangestart
rangeend
functionorname
maplinechunksformods of Text
mapLineChunksForMods me, rangestart, rangeendpair, functionorname
me (a Text)
rangestart
rangeendpair
functionorname
mapstates of Text
mapStates me, fromState, toState, functionorname
Page 815
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 o f Te x t
me (a Text)
fromstate
tostate
functionorname
mapstatesformods of Text
mapStatesForMods me, fromState, tostateholder, functionorname
me (a Text)
fromstate
tostateholder
functionorname
mapstatesformodstyped of Text
mapStatesForModsTyped me, type, fromState, tostateholder,
functionorname
me (a Text)
type
fromstate
tostateholder
functionorname
mapstatestyped of Text
mapStatesTyped me, type, fromState, toState, functionorname
me (a Text)
type
fromstate
tostate
functionorname
nextstate of Text
nextState me, state
me (a Text)
state
Page 816
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
n e x t s t a t e t y p e d o f Te x t
nextstatetyped of Text
nextStateTyped me, type, state
me (a Text)
type
state
nthitem of Text
nthItem me, n
me (a Text)
n
nthitemtyped of Text
nthItemTyped me, type, n
me (a Text)
type
n
nthpreviousstate of Text
nthPreviousState me, n, fromState
me (a Text)
n
fromstate
nthpreviousstatetyped of Text
nthPreviousStateTyped me, type, n, fromState
me (a Text)
type
n
fromstate
nthstate of Text
nthState me, n, fromState
Page 817
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
n t h s t a t e t y p e d o f Te x t
me (a Text)
n
fromstate
nthstatetyped of Text
nthStateTyped me, type, n, fromState
me (a Text)
type
n
fromstate
numitems of Text
numItems me, fromState, toState
me (a Text)
fromstate
tostate
numitemstyped of Text
numItemsTyped me, type, fromState, toState
me (a Text)
type
fromstate
tostate
reversemaplinechunks of Text
reverseMapLineChunks me, rangestart, rangeend, functionorname
me (a Text)
rangestart
rangeend
functionorname
stateequal of Text
stateEqual me, state1, state2
Page 818
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s t a t e g r e a t e r t h a n o f Te x t
me (a Text)
state1
state2
stategreaterthan of Text
stateGreaterThan me, state1, state2
me (a Text)
state1
state2
writeobject of Text
writeObject me, thestream, rereadably
me (a Text)
thestream
rereadably
TextChunk
(an Object)
Properties of TextChunk
forwardmapper of TextChunk
Getter
get the forwardMapper of me
Page 819
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
f o r w a r d m a p p e r f o r m o d s o f Te x t C h u n k
Setter
set the forwardmapper of me
to NewValue
forwardmapperformods of TextChunk
Getter
get the forwardMapperForMods of me
Setter
set the forwardmapperformods of me
to NewValue
reversemapper of TextChunk
Getter
get the reverseMapper of me
Setter
set the reversemapper of me
to NewValue
textField
(an EditText)
An editText and a scroller which are partnered. The scroller is affixed to the editText. The TextField is
the editText.
This actor is a bit strange in that it behaves as a rectangle containing the editText and the scroller when in
reality there is no such thing: the scroller and the editText are always placed in the same container and
the boundsRect handler is modified to make them appear to be one entity.
Note: setting the container of a TextField to the Stage will cause the editText to be disconnected from
the scroller. This will be very rarely what you want.◆
See Also
partnerScroller and affixedScrollers of EditText .
Page 820
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o n t a i n e r o f Te x t F i e l d
Properties of textField
container of TextField
The TexField just redefines the set container handler to make sure that the
partnered scroller always stays in the container of the editText.
Setter
set the container of me
to NewValue
Does the inherited handler to add the textField to the new container. Then it adds the
scroller to the new container also. This is how we keep the editText and the scroller
together.
me (a TextField)
to: An Actor or False .
Handlers of textField
boundsrect of TextField
boundsRect me
with physical
Returns the union of the editText's boundsRect and the boundsRect of its partnered
scroller.
me (a TextField)
[with physical] (a boolean): If True , the boundsRect is returned in Stage
coordinates.
initialize of TextField
initialize me, original, isnew, initargs
Does the inherited handler, then it sets the textField's boundsRect in order to snap the
scroller into the right place.
Page 821
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e t b o u n d s r e c t o f Te x t F i e l d
me (a TextField)
original
child
args
setboundsrect of TextField
setBoundsRect me, ll, tt, rr, bb
with physical
with relative
with justmoving
The boundsRect of the textField is, in fact, the boundsRect of the textField itself plus the
boundsRect of its associated scroller. Thus, this handler is redefined to fit both actors in
the boundsRect specified.
me (a TextField)
ll: The left of the boundsRect.
tt: The top of the boundsRect.
rr: The right of the boundsRect.
bb: The bottom of the boundsRect.
[with physical] (a boolean): If True , the coordinates given are assumed to be
in Stage coordinates.
[with relative] (a boolean): If True , the values provided are assumed to be
offsets from the current boundsRect.
[with justmoving] (a boolean): If True , you inform the graphics system that
the actor is not actually changing size, but just moving. This allows the
system to do a number of optimization. This argument also determines
whether moved or resized gets called on the actor.
textList
(a Rectangle)
Page 822
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 Te x t L i s t
You can specify the type of picker than you want to use in your textList by setting the
pickerPrototype property.
See Also
pickerPrototype , picker and the Picker object.
Properties of textList
alphabeticaldisplay of TextList
This property controls whether the textList's picker sorts the items for displaying them
or not.
Getter
get the alphabeticalDisplay of me
me (a TextList)
Setter
set the alphabeticaldisplay of me
to NewValue
me (a TextList)
to (a boolean)
See Also
alphabeticalDisplay of Picker.
items of TextList
The items property of the TextList is just an interface to its picker.
Getter
get the items of me
me (a TextList)
Page 823
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l i n e s p a c i n g o f Te x t L i s t
Setter
set the items of me
to NewValue
me (a TextList)
to: A list of objects.
See Also
linespacing of TextList
Specifies the lineSpacing of the textList's picker.
Getter
get the lineSpacing of me
me (a TextList)
Setter
set the linespacing of me
to NewValue
me (a TextList)
to (an Integer)
See Also
lineSpacing of Picker.
Picker of TextList
Returns the picker being used to show the list of items.
Note: This property is a tag.◆
Getter
get the Picker of me
Page 824
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p i c k e r p r o t o t y p e o f Te x t L i s t
Setter
set the picker of me
to NewValue
pickerprototype of TextList
Specifies the picker to use for the textList and to use when creating new children of it.
Using this property you can install any type of picker in the textList.
Getter
get the pickerprototype of me
me (a TextList)
Setter
set the pickerprototype of me
to NewValue
me (a TextList)
to: The new picker to be used. Can be a descendant of Picker,
TablePicker or EditText .
selecteditems of TextList
Specifies the selectedItems of the textList's picker.
Getter
get the selectedItems of me
me (a TextList)
Setter
set the selecteditems of me
with upwards
with deselecting
to NewValue
Page 825
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e l e c t i o n o f Te x t L i s t
me (a TextList)
[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
selectedItems of picker.
selection of TextList
This property specifies which items in the TextList's 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 TextList)
Setter
set the selection of me
with upwards
with deselecting
to NewValue
me (a TextList)
[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
selection of Picker.
Page 826
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 Te x t L i s t
selectionstyle of TextList
Specifies the selectionStyle of the textList's picker.
Getter
get the selectionStyle of me
me (a TextList)
Setter
set the selectionstyle of me
to NewValue
me (a TextList)
to: The new selection style. One of 'single' , 'contiguous' and
'discontiguous' .
See Also
title of TextList
Specifies the text of the textList's titlebar.
Getter
get the title of me
me (a TextList)
Setter
set the title of me
to NewValue
me (a TextList)
to (a String)
See Also
titlebar.
Page 827
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t i t l e b a r o f Te x t L i s t
titlebar of TextList
Returns the rectangle used as the textList's titlebar. If you do not desire a titlebar, just hide
it and the textList will resize its parts to make use of the available space.
Note: This property is a tag.◆
Getter
get the titleBar of me
Setter
set the titlebar of me
to NewValue
vscroller of TextList
Returns the scroller used to scroll the items in the textList's picker.
Note: This property is a tag.◆
Getter
get the vScroller of me
Setter
set the vscroller of me
to NewValue
Handlers of textList
additems of TextList
addItems me, itemlist
The addItems handler appends the items in itemList to the items in the textList's picker.
This handler is used when you just want to add items to the end of the textList (this is
actually used by the picker in the warningbox).
me (a TextList)
itemlist: The list of things to be appended to the items of the textList's
picker.
Page 828
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a u t o k e y o f Te x t L i s t
See Also
addItems of Picker.
autokey of TextList
autoKey me, thechar
Sends a keyDown event to the textList's picker.
me (a TextList)
thechar (a Character): The character that is being held down.
See Also
keyDown of Picker.
bestsize of TextList
bestSize me
Sends the resized event to itself in order to set the size of its contents.
me (a TextList)
See Also
resized .
contentarea of TextList
contentArea me
Returns the textList's picker.
me (a TextList)
See Also
picker.
initialize of TextList
initialize me, original, isnew, initargs
Partners the textList's scroller to its picker
Page 829
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i t e m v i s i b l e o f Te x t L i s t
me (a TextList)
original
child
args
itemvisible of TextList
itemVisible me, item
Returns whether item is currently visible in the textList's picker. Calls the
itemVisible handler of the Picker to find out.
me (a TextList)
item: The item that is being tested to see if it is currently visible.
See Also
itemVisible of Picker.
keydown of TextList
keyDown me, thechar
Sends the keyDown event to the textList's picker.
me (a TextList)
thechar (a Character): The character that was typed.
See Also
keyDown of Picker.
keyup of TextList
keyUp me, thechar
Sends the keyUp event to the textList's picker.
me (a TextList)
thechar (a Character): The character that was let up.
See Also
keyUp of Picker.
Page 830
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m o u s e d o w n o f Te x t L i s t
mousedown of TextList
mouseDown me
Sets the keyTarget of the textList's window to the textList and then does the inherited
handler.
me (a TextList)
See Also
keytarget of Actor.
pointonwhichpart of TextList
pointOnWhichPart me, x, y
with part
If part equals 'item' , this handler returns the position of the item under the {x,y}
point (by calling the pointOnWhichPart handler of its picker ). Otherwise, the actor's
pointOnWhichPart method is called.
me (a TextList)
x: The horizontal location we want to test at. Should be in Stage coordinates.
y: The vertical location we want to test at. Should be in Stage coordinates.
[with part]: The part we are testing for a hit. Can be any of the actor options
or 'item' to see which item in the textList's picker was hit.
See Also
resized of TextList
resized me
Resizes its picker and vScroller to fit nicely within its new bounds.
me (a TextList)
selectioncompleted of TextList
selectionCompleted me
The selectionCompleted handler is called when the system determines that the
selection process is complete.
Page 831
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c u r r e n t c h a r a c t e r o f Te x t S t r e a m
The idea is to let the textList know that the selection has changed because it might want to
perform some action at this point. The selection is considered complete when the user
releases the mouse or a key (that is, the default picker mouseUp and keyUp handlers call
this handler).
The default handler for textList does nothing.
me (a TextList)
See Also
selectionCompleted of Picker.
TextStream
(a Text, Stream)
TextStreams are used for text and characters. TextStreams have an understanding of words, paragraphs,
lines, and so forth.
You can access text files through path expressions which contain the following selectors:
character (abbreviated char)
word
line
paragraph
Example
get every word whose length < 4 in MyTextStream
set every word = "wrong" to "right" in MyTextStream
Handlers of TextStream
currentcharacter of TextStream
currentCharacter me, state
me (a TextStream)
state
Page 832
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e l e m e n t t y p e o f Te x t S t r e a m
elementtype of TextStream
elementType me
The elementType of a TextStream is always a Character.
me (a TextStream)
mapcharacterchunks of TextStream
mapCharacterChunks me, rangestart, rangeend, functionorname
me (a TextStream)
rangestart
rangeend
functionorname
maplinechunks of TextStream
mapLineChunks me, rangestart, rangeend, functionorname
me (a TextStream)
rangestart
rangeend
functionorname
mapparagraphchunks of TextStream
mapParagraphChunks me, rangestart, rangeend, functionorname
me (a TextStream)
rangestart
rangeend
functionorname
mapwordchunks of TextStream
mapWordChunks me, rangestart, rangeend, functionorname
me (a TextStream)
rangestart
rangeend
functionorname
Page 833
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
n e x t c h a r a c t e r o f Te x t S t r e a m
nextcharacter of TextStream
nextCharacter me
me (a TextStream)
readcharacter of TextStream
readCharacter me
Returns the next Character in the TextStream, or False if the end of the stream has been
reached.
me (a TextStream)
See Also
writeCharacter, nextCharacter
readline of TextStream
readLine me
Reads and returns a string from the TextStream, up to the next newline character (or to the
end of the stream if no newline characters are reached), or returns False if the end of the
Stream has been reached.
me (a TextStream)
readword of TextStream
readWord me
Reads and returns a string from the TextStream, up to the next word delimiter, or returns
False if the end of the Stream has been reached.
me (a TextStream)
See Also
nextWord, writeWord
reversemapcharacterchunks of TextStream
reverseMapCharacterChunks me, rangestart, rangeend, functionorname
Page 834
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e v e r s e m a p l i n e c h u n k s o f Te x t S t r e a m
me (a TextStream)
rangestart
rangeend
functionorname
reversemaplinechunks of TextStream
reverseMapLineChunks me, rangestart, rangeend, functionorname
me (a TextStream)
rangestart
rangeend
functionorname
reversemapparagraphchunks of TextStream
reverseMapParagraphChunks me, rangestart, rangeend, functionorname
me (a TextStream)
rangestart
rangeend
functionorname
reversemapwordchunks of TextStream
reverseMapWordChunks me, rangestart, rangeend, functionorname
me (a TextStream)
rangestart
rangeend
functionorname
writecharacter of TextStream
writeCharacter me, char
Writes the Character to the TextStream.
me (a TextStream)
char
Page 835
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w r i t e l i n e o f Te x t S t r e a m
See Also
readCharacter, nextCharacter
writeline of TextStream
writeLine me, linee
Writes a String to the textStream and then writes a NewLine character afterwards.
me (a TextStream)
linee
See Also
writestring of TextStream
writeString me, stringg
Writes the String to the TextStream.
me (a TextStream)
stringg
writeword of TextStream
writeWord me, wordd
Writes the word, a string, to the TextStream.
me (a TextStream)
wordd
Example
writeWord “word” TextStream
See Also
readWord, nextWord
Page 836
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w r i t e w o r d o f Te x t S t r e a m
ThisApplicationAETarget
(an AETarget)
See Also
AETarget, AppleEvent
Today
(a DateTimeIndirect)
The Today object is a child of date whose secondsSince1904 value is bound to the clock in the Macintosh.
Today is designed to be used as a handy reference. Today's values can not be set; you can only get them.
Associated with Today is the function now():
Now () is a function that takes no arguments. It returns the number of seconds since 1/1/1904, according
to your Macintosh.
now()
Returns 2811529348
Page 837
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w r i t e w o r d o f Te x t S t r e a m
Properties of Today
Handlers of Today
translator
(an Object)
Translators are objects that know how to turn SK8 objects into forms that
can be used by the outside world (e.g., the Mac OS) and vice versa. By adding more translators you can
increase the kind of SK8 objects that can be exported to other apps in your system and at the same time
the number of objects that can be brought into SK8 from any external source.
A child of Translator must be implemented for each kind of data translation (e.g., one which takes a
SK8 ImageRenderer and turns it into a "PICT" file). SK8 provides facilities to query the kinds of
translations available and for automatically attempting translations. (Note that SK8 will adapt itself to
the available translators.)
A convention is followed in the naming of translator objects. The name starts with the SK8 object the
translator exports (eg. Sound ). Then "to" followed by the name of the operating system analog of the SK8
object (eg. "snd" for the resource type). We end the name with "Translator". The translator in our example
is thus called:
SoundTosndTranslator
Translators do all their work with the import and export handlers.
You can see translators at work in the Import Media Dialog and in the SK8Clipboard when you (for
example) cut a PICT in some graphics program and paste it into SK8.
Note: Writing translators is an inherently low level endeavor requiring use of the foreign funtion
interface to (very possibly) call traps.◆
See Also
import and export with their associated low level handlers, canImport , canExport and the
Clipboard object for more details on how translators are used.
Page 838
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
fi n a l o b j e c t o f Tr a n s l a t o r
Properties of translator
finalobject of Translator
This property specifies the final SK8 object that is created as the result of a translation.
This property exists to allow translators to do two level translation: from a pointer to
media to a SK8 media object and then to a higher level object that uses the media.
Consider for example the ImageRendererToPICTTranslator. It takes a reference to a "PICT"
and makes an imageRenderer out of it, the finalObject is ImageRenderer, but the internal
object (the media analog) is QDPicture.
Getter
get the finalObject of me
If the finalObject is not False , it is returned. Otherwise the finalObject and the
internalObject are the same and the internalObject is returned.
me (a translator)
Setter
set the finalobject of me
to NewValue
me (a translator)
to: An object or False to indicate than the finalObject is the
internalObject .
See Also
internalObject .
internalobject of Translator
Specifies the SK8 media object that this translator creates when the media is imported.
This object is the actual analog to the media being imported. If importing a "PICT"
resource, the internalObject would be a QDPicture . If importing an "snd " resource,
the internalObject would be a SoundRSRC .
Page 839
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c a n E x p o r t o f Tr a n s l a t o r
Getter
get the internalObject of me
me (a translator)
Setter
set the internalobject of me
to NewValue
me (a translator)
to
See Also
Handlers of translator
canExport of Translator
canExport me, source, destination
Returns whether this translator knows how to export the source provided. The source
must inherit from the translator's finalObject . The destination can be a file, a media
or the SK8Clipboard . If it is a descendant of Media , it must inherit from the translator's
internalObject .
me (a translator)
source
destination
canimport of Translator
canImport me, source, destination
Returns whether the translator specified can perform the import operation required. The
arguments should be provided in the exact same format in which import would be called.
The source argument specifies the source of the import. If it is a file object, it is assumed
that the media in question is a handle in its data fork. The file must exist and be of the
right type. If it is a media object, it is assumed to be a handle in the resource fork of a file.
Finally, it is is the Sk8Clipboard object, the handle is assumed to be in the scrap.
Page 840
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e x p o r t o f Tr a n s l a t o r
If the destination is provided it must inherit from the internalObject of the translator.
me (a translator)
source: A file, a media object or the SK8Clipboard .
[destination]: The Sk8 object that would be created as a result of the import.
See Also
import .
export of Translator
export me
with source
with destination
This handler exports media from SK8 to the outside world. Calls exportToFile,
exportToResource or exportToClipboard depending on the type of the destination.
me (a Translator)
with source: The object whose media is to be exported. Should inherit from
the translator's finalObject .
with destination: Either a file, a media object or the SK8Clipboard .
exporttofile of Translator
exportToFile me
with source
with destination
Performs an export operation writing the data to the data fork of the file specified in the
destination argument. This handler must be defined by individual translators. The default
handler reports an error when called specifying that the translator does not know how to
perform this operation.
me (a translator)
with source
with destination: The file the data will be written to.
externaltype of Translator
externalType me
Returns the OSType the translator knows how to deal with. The default handler gets the
resType of the translator's internalObject .
Page 841
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i m p o r t o f Tr a n s l a t o r
me (a translator)
See Also
import of Translator
import me
with source
with destination
This is the handler that imports data into SK8 from the outside world. The data may be
found in many places in the outside world: in the data fork of a file, in the resource fork of
a file or on the clipboard. This handler knows how to import from any of these sources.
The source argument should completely specify all the information required to get to the
data.
If the data we want to import is in the resource fork of a file, the source should be a file
object pointing to this file. The file must really exist and its macFileType must be the
same as the translator's externalType .
If the data we want to import is a resource in the resource fork of a file, the source must be
a SK8 media object with the right restype . Its file must exist and a resource of the right
resourceId should exist also. As an example, consider wanting to import a "PICT"
handle that is the PICT #2345 from the resource file FooFile. An appropriate source would
be created as follows:
new QDPicture with file FooFile with resourceId 2345
Finally, if the media is in the clipboard (say after copying a PICT from a program like
MacDraw), all you need provide is the SK8Clipboard object.
The destination must be an object that inherits from the translator's internalObject .
Note that the destination object must be created by you in advance to calling the import
handler. The import handler will just import the real data and fill in the destination to
point to it.
In the destination you specify whether you want the media to be stored in the project file
of the destination or in the file the media originally is. This is specified by setting the file
of the destination. Continuing our example, here is an appropriate destination object to
import the PICT handle:
new QDPicture
Note that if no file is specified, the QDPicture's file is its project file meaning that the
media will be copied to it. No resourceId is required either since the import handler
will fill it in after is has copied the media.
To tell the system to leave the media where it is you need to set the file of the
destination to a file object that points to the file where the media really is. Note that
although you can get this file from the file of the source , you must ensure that the file
Page 842
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i m p o r t f r o m c l i p b o a r d o f Tr a n s l a t o r
you use in the destination is a file object in your project (since the source is not
required to be an object in your project). For that you can use the findFileInProject
function as follows:
set theFile to findFileInProject(the source's file, the
destination's project)
new QDPicture with file theFile
Now you are ready to call this handler. This handler checks the type of the source and
then calls importFromFile , importFromResource or importFromClipboard to do
the work.
Note: this handler should not be called if the translator cannot import the media you
want to import. Call canImport to find out.◆
me (a Translator)
with source
with destination
See Also
importfromclipboard of Translator
importFromClipBoard me, source, destination
This handler is called to perform an import operation when the source of the operation is
the SK8Clipboard . If the destination 's file is its project file, the media is copied to
it from the source . At the end of this operation the destination will have a valid
reference to the media.
This handler assumes a handle of the right type is available on the scrap and will yield an
error if this is not the case.
me (a translator)
source
destination
See Also
importfromfile of Translator
importFromFile me, source, destination
Page 843
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i m p o r t f r o m r e s o u r c e o f Tr a n s l a t o r
This handler is called to perform an import operation when the source of the operation is
a descendant of File. If the destination 's file is its project file, the media is copied to it
from the source . At the end of this operation the destination will have a valid
reference to the media.
The importFromFile handler is defined on a few media types. An error is signaled if a
translator does not know how to do this operation and this handler is called. If you create
a new translator you have to define this handler yourself. If you choose not to support this
type of importing, just redefine the canImport handler to return false when the source is
a file object.
Note: if the media is to be left in its original file, the destination 's resourceId is set
to False to signify that this item is not a resource but a handle in the data fork of its
file .◆
me (a translator)
source
destination
See Also
importfromresource of Translator
importFromResource me, source, destination
This handler is called to perform an import operation when the source of the operation
is a descendant of Media . If the destination 's file is its project file, the media is
copied to it from the source . At the end of this operation the destination will have a
valid reference to the media.
me (a translator)
source
destination
See Also
TwoByNBrowserPicker
(a TablePicker, TablePickerEditorAddOn,
SelectByRowTablePickerAddOn)
Page 844
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e d i t i n g o f Tw o B y N B r o w s e r P i c k e r
This is a table picker modified to make a two column picker where the left side shows some item and the
right side shows some additional information about that item. For example, this is used to make the
propertysheetpicker which displays properties in the first column and values in the second
columns.
Properties of TwoByNBrowserPicker
editing of TwoByNBrowserPicker
This is defined here so other pickers can inherit it. By default it does nothing.
Getter
get the editing of me
Setter
set the editing of me
to NewValue
Handlers of TwoByNBrowserPicker
createSecondItem of TwoByNBrowserPicker
createSeconditem me, theitem
This handler is called to create the items that will appear in the second column of the
tablepicker. It is called on the TwoByNBrowserPicker for each item, every time the
items are set. It is passed an item as its second argument. The returned value must be a
string as it is also used in creating the imageArray of the tablepicker.
me (a TwoByNBrowserPicker)
theitem
Example
on createSecondItem(me (a TwoByNBrowserPicker), curItem)
return the objectstring of the curItem
end createSecondItem
Page 845
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
fi n d A n d S e l e c t o f Tw o B y N B r o w s e r P i c k e r
findAndSelect of TwoByNBrowserPicker
findAndSelect me, partialstring
The findAndSelect handler searches through the Picker's items to find the first item
whose string representation starts with string. When the item is found, the Picker scrolls
to it. This handler is called by the Picker's built in search mechanism.
me (a TwoByNBrowserPicker)
partialString
TwoNumberPropertyEditor
(a SimplePropertyEditor)
This is a tiny editor for getting two numbers from a user to specify the value of some property, (e.g.
size ). There is an objects property and a propertyname property to specify what it is editing. The
user can type a value into the two textfields and the list of these two values is put into the property when
either the user types return or enter or when the text is deactivated.
Properties of TwoNumberPropertyEditor
number1 of TwoNumberPropertyEditor
This tags the first textfield.
Getter
get the number1 of me
Setter
set the number1 of me
to NewValue
number2 of TwoNumberPropertyEditor
This tags the second textfield.
Page 846
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o b j e c t s o f Tw o N u m b e r P r o p e r t y E d i t o r
Getter
get the number2 of me
Setter
set the number2 of me
to NewValue
objects of TwoNumberPropertyEditor
This property specifies the list of objects whose property is being edited.
Setter
set the objects of me
to NewValue
me (a TwoNumberPropertyEditor)
to
Handlers of TwoNumberPropertyEditor
currentvalue of TwoNumberPropertyEditor
currentValue me
This returns the value specified in the two text fields or False if it is not a number.
me (a TwoNumberPropertyEditor)
TypeMismatchError
(a ProgrammaticError)
See Also
The Condition System section of the User Guide's SK8Script Language chapter
Page 847
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e x p e c t e d t y p e o f Ty p e M i s m a t c h E r r o r
Properties of TypeMismatchError
expectedtype of TypeMismatchError
Getter
get the expectedType of me
Setter
set the expectedtype of me
to NewValue
Object of TypeMismatchError
Getter
get the Object of me
Setter
set the object of me
to NewValue
Handlers of TypeMismatchError
writeobject of TypeMismatchError
writeObject me, thestream, rereadably
me (a TypeMismatchError)
thestream
rereadably
Page 848
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w r i t e o b j e c t o f Ty p e M i s m a t c h E r r o r
TypeTable
(a Table)
A form of Table that uses the is a operator when testing whether a key is matched. In other words, it
is keyed on type-conformace of a given object to the key object — i.e. an object matches the key that is its
nearest ancestor (or itself).
Note: When setting an item corresponding to a given key, TypeTable uses the same object operator
(rather than is a ) to find the key (or determine that it needs to be added).◆
See Also
Table , TypeTable , is a , same object
UI
(a Project)
The UI project is the project of SK8's Project Builder. It is not designed to be modified or saved by the
system. Change it at your own peril.
uiRectangleInBevel
(a BevelRenderer)
This bevelRenderer shades the left side black, the top dark gray and bottom and right sides light
gray. A rectangle with this as it's framecolor will have the three dimensional appearance of being
beveled inward.
uiRectangleOutBevel
(a BevelRenderer)
Page 849
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
v a r i a b l e n a m e o f U n b o u n d Va r i a b l e E r r o r
This bevelRenderer shades the left side black, the top dark gray and bottom and right sides light
gray. A rectangle with this as it's color will have the three dimensional appearance of being beveled
outward.
UnboundVariableError
(a ProgrammaticError)
See Also
The Condition System section of the User Guide's SK8Script Language chapter
Properties of UnboundVariableError
variablename of UnboundVariableError
Getter
get the variableName of me
Setter
set the variablename of me
to NewValue
Handlers of UnboundVariableError
writeobject of UnboundVariableError
writeObject me, thestream, rereadably
me (an UnboundVariableError)
thestream
rereadably
Page 850
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a r g u m e n t s o f U n d e fi n e d H a n d l e r E r r o r
UndefinedHandlerError
(a ProgrammaticError)
See Also
The Condition System section of the User Guide's SK8Script Language chapter
Properties of UndefinedHandlerError
arguments of UndefinedHandlerError
Getter
get the arguments of me
Setter
set the arguments of me
to NewValue
handlername of UndefinedHandlerError
Getter
get the handlerName of me
Setter
set the handlername of me
to NewValue
Page 851
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w r i t e o b j e c t o f U n d e fi n e d H a n d l e r E r r o r
Handlers of UndefinedHandlerError
writeobject of UndefinedHandlerError
writeObject me, thestream, rereadably
me (an UndefinedHandlerError)
thestream
rereadably
UndoableSetLog
(a DataObject)
This object is part of the basic undo structure provided by SK8. It records the state of the property or
properties that have been set by calling the function UndoableSet or that have been "undone" or reset
by calling the function UndoLastSet . These functions work as follows. When UndoableSet is called
to set the value of a property on a set of objects, the old values of these properties are stored in the
UndoableSetLog . Whenever UndoLastSet is called, it resets the values of the properties to the
original values and stores the current values so the undo can be undone.
Note that this is not a full undo in that if a property has some side effects which are not undone by
resetting the property than such side effects will not be removed.
Properties of UndoableSetLog
ObjectList of UndoableSetLog
This stores the list of objects on which the property has been set.
Getter
get the ObjectList of me
Page 852
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p r o p e r t y n a m e o f U n d o a b l e S e t L o g
Setter
set the objectlist of me
to NewValue
propertyname of UndoableSetLog
This stores the name of the property which has been set.
Getter
get the propertyName of me
Setter
set the propertyname of me
to NewValue
valuelist of UndoableSetLog
This is a list which stores the old values to the property for each of the objects in the
objectlist respectively.
Getter
get the valueList of me
Setter
set the valuelist of me
to NewValue
Handlers of UndoableSetLog
clearreferences of UndoableSetLog
clearReferences me
with objects
This makes sure the log is cleared.
me (an UndoableSetLog)
[with objects]
Page 853
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a r g u m e n t s o f U n k n o w n E r r o r
UnknownError
(a SystemError)
See Also
The Condition System section of the User Guide's SK8Script Language chapter
Properties of UnknownError
arguments of UnknownError
Getter
get the arguments of me
Setter
set the arguments of me
to NewValue
ValueEditor
(a TextList)
Example
set the inputObjects of the Picker of SuperCoolValueEditor to {rectangle,
oval, roundrect}
Page 854
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e d i t i n g o f Va l u e E d i t o r P i c k e r
ValueEditorPicker
(a TablePicker, BrowserComponent, TablePickerEditorAddOn)
This is also a property editing component and has the inputObjects and InputProperty properties.
It displays the values in the form of a list of values. The user can edit a single item of the value by
pressing return as in the PropertySheetPicker.
Properties of ValueEditorPicker
editing of ValueEditorPicker
This specifies whether or not the user can edit the information in the field.
Getter
get the editing of me
Setter
set the editing of me
to NewValue
editinglist of ValueEditorPicker
This property is used by the ValueEditorPicker to specify whether or not the property
it is currently editing holds a list as a value. This property should not be modified by the
user.
Getter
get the editingList of me
Setter
set the editinglist of me
to NewValue
inputobjects of ValueEditorPicker
This specifies on which set of objects the inputProperty is being edited.
Page 855
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n p u t p r o p e r t y o f Va l u e E d i t o r P i c k e r
Getter
get the inputObjects of me
Setter
set the inputobjects of me
to NewValue
me (a ValueEditorPicker)
to
inputproperty of ValueEditorPicker
This specifies which property of the inputObjects is being edited.
Getter
get the inputProperty of me
Setter
set the inputproperty of me
to NewValue
me (a ValueEditorPicker)
to
outputString of ValueEditorPicker
This property is set when setOutputString is called. The property is set to the
appropriate SK8Script Expression to generate the list it is editing. This is usually in the
form of "the <property> of <object>".
Getter
get the outputString of me
Setter
set the outputstring of me
to NewValue
Page 856
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e t o u t p u t s t r i n g o f Va l u e E d i t o r P i c k e r
Handlers of ValueEditorPicker
setoutputstring of ValueEditorPicker
setOutputString me
This causes the outputString property to be set. See there for more details.
me (a ValueEditorPicker)
ValueText
(an EditText, BrowserComponent)
This is a property editing component. It is a simple text with two inputs. The first is InputObjects ,
the second is InputProperty. It displays either the value of the property or if the value is different for
the different inputobjects , then it displays "Objects have different values in this property". The user
can enter a SK8Script expression and the value of the property will be set to the result.
Properties of ValueText
inputobjects of ValueText
This specifies the set of objects being edited.
Getter
get the inputObjects of me
Setter
set the inputobjects of me
to NewValue
me (a ValueText)
to
Page 857
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n p u t p r o p e r t y o f Va l u e Te x t
inputproperty of ValueText
This specifies the property being edited.
Getter
get the inputProperty of me
Setter
set the inputproperty of me
to NewValue
me (a ValueText)
to
outputstring of ValueText
This property can specify a SK8Script String specifying the property being edited.
Getter
get the outputString of me
Setter
set the outputstring of me
to NewValue
Handlers of ValueText
VariableSheet
(a TextList)
Page 858
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t y p e S a t i s fi e d o f Vi r t u a l Ty p e
Example
set the inputProject of the Picker of SuperCoolVariableSheet to SK8
VariableSheetPicker
(a ProjectDataSheetPicker)
VirtualType
(an Object)
For most objects, the is a operator simply indicates whether the first object is a descendant of the
second object (or is that object itself). A VirtualType , however, when used as the second argument to
the is a operator, calls its typeSatisfied handler which may perform arbitrary computation based
on the two arguments. The typeSatisfied handler must simply return True or False ; this, in turn, is
the value returned by is a .
See Also
typeSatisfied , is a , PositiveInteger, NonNegativeInteger, EnumeratedType
Handlers of VirtualType
typeSatisfied of VirtualType
typesatisfied me, obj
based on the type and the given object.
This handler is called to determine whether the given object “satisfies” this type. It may
perform arbitrary computation based on the two arguments. It should simply return True
or False (this is the value that will be returned by is a ).
me (a VirtualType)
object
Page 859
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t y p e S a t i s fi e d o f Vi r t u a l Ty p e
See Also
is a
VisualEffect
(an Effect)
The VisualEffect object provides an extensive sets of transitional visual effects for the graphics
system. The visual effects take place whenever a window unlocks itself all the way. The window redraws
itself and performs the visualEffect at the time when it does the graphical udpate.
The built in visual effects provided by SK8 are: WipeDown , WipeUp , WipeRight , WipeLeft ,
RandomRows , OpenVenetians , CloseVenetians , SerialTile , RandomTile , PushDown , PushUp ,
PushRight , PushLeft , SlideUp , SlideDown , SlideRight , SlideLeft , FanHouseDown ,
FanHouseUp , FanHouseRight , FanHouseLeft , Blend , CloseIris , OpenIris , ZoomIn ,
FlipRight , FlipLeft , FlipUp , and FlipDown .
See Also
unlock of Actor for an example of how to play visual effects.
WindowsMenu
(a Menu)
The "Windows" menu of the SimpleMenubar. Contains a menuItem for each window on the Stage.
Selecting a menu item selects the window it represents. Windows are shown in front to back order.
Handlers of WindowsMenu
Word
(a TextChunk)
Page 860
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t y p e S a t i s fi e d o f Vi r t u a l Ty p e
ZoomIn
(a VisualEffect)
Page 861
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t y p e S a t i s fi e d o f Vi r t u a l Ty p e
Page 862
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
=
Functions
=
= object1, object2
with exactmatch
Tests the equality of object1 and object2; returns True to indicate equality, False to
indicate inequality.
The behavior of = is entirely determined by the equalTo handler. Thus, its behavior can
be specialized for a given object by defining an equalTo handler on that object.
When the exactMatch argument is True , the equality test is generally more restrictive (e.g.
when comparing text, case matters). For specifics about how exactMatch affects equality
tests see each of the equalTo handlers.
Note: SK8Script's = operator (and its synonyms) call this function.◆
object1
object2
[with exactMatch]: This value is used for the exactMatch argument when
calling equalTo .
See Also
equalTo
>
> object1, object2
Returns True to indicate equality, False to indicate inequality.
The behavior of > is entirely determined by the greaterThan handler. Thus, its behavior
can be specialized for a given object by defining a greaterThan handler on that object.
Note: SK8Script's > operator (and its synonyms) call this function.◆
object1
object2
Page 863
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a b o r t B r e a k
See Also
greaterThan
abortBreak
abortBreak
with postaborthandler
with handlerargument
Aborts the current event-processing level (i.e. the chain of currently running handlers/
functions called in response to the current —most recent— event). The effect is essentially
to cancel the handling of the current event.
abortBreak is much like abortEvent , but if the current event-processing is happening
within a "break state" (i.e. when a handler called in the previous event-processing level is
stopped at a breakpoint or a runtime error) it will abort that event-processing level too.
abortBreak is different from abortError in that it has the same effect for both kinds of
break states (i.e. handler stopped at a breakpoint or an error).
If a postAbortHandler argument is provided, it is called with a single argument, the given
handlerArgument, after the event-processing level has been exited.
See Also
abortError
abortError
with postaborthandler
with handlerargument
Aborts the current event-processing level (i.e. the chain of currently running handlers/
functions called in response to the current —most recent— event). The effect is essentially
to cancel the handling of the current event.
abortError is much like abortEvent , but if the current event-processing is happening
within a "runtime error state" (i.e. when a handler called in the previous event-processing
level is stopped at a runtime error) it will abort that event-processing level too.
abortError is different from abortBreak in that it only aborts an extra
event-processing leval when the current break state is due to a runtime error.
If a postAbortHandler argument is provided, it is called with a single argument, the given
handlerArgument, after the event-processing level has been exited.
Page 864
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a b o r t E v e n t
See Also
abortEvent
abortEvent
with postaborthandler
with handlerargument
Aborts the current event-processing level (i.e. the chain of currently running handlers/
functions called in response to the current —most recent— event). The effect is essentially
to cancel the handling of the current event.
If a postAbortHandler argument is provided, it is called with a single argument, the given
handlerArgument, after the event-processing level has been exited.
See Also
abs
abs Number
This function returns the absolute value of its argument. It is an error if the argument is
not a number.
number
acos
acos radians
This function returns the arc cosine of its argument. The result is in radians. It is an error if
the argument is not a number.
Page 865
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a c o s h
number
See Also
sin , cos , tan , asin , acos , atan , sinh , cosh , tanh , asinh , acosh , atanh
acosh
acosh radians
This function returns the hyperbolic arc cosine of its argument. It is an error if the
argument is not a number.
number
See Also
sin , cos , tan , asin , acos , atan , sinh , cosh , tanh , asinh , acosh , atanh
activemode
activeMode
This function is used to determined the system's active eventMode . It takes no
arguments. It returns False if no mode is active and default event processing is occuring.
actorathvcoordinates
actorAtHVCoordinates h, v
Returns a reference to the deepest actor at the given physical coordinates. Note that
mouseSensitivity is ignored. If no actor is at the coordinates, the stage is returned.
h (an Integer)
v (an Integer)
actorsbounds
actorsBounds actorlist
with physical
This returns the minimum physical boundsRect surrounding a group of actors.
Page 866
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a c t u a l B a s e Te x t
actualBaseText
actualBaseText textobject
This function returns the actual “direct” text object underlying the given IndirectText
object. That is, if the input's baseText is not a descendant of IndirectText then the
input's baseText is returned; otherwise the input's baseText is considered to be the
input and the process starts over.
textObject
See Also
IndirectText , actualBaseTextAndRange
actualBaseTextAndRange
actualBaseTextAndRange textobject
This function returns a list of three items: the actual “direct” text object underlying the
given IndirectText object, the start state for the range covered by the given
IndirectText object, and the end state for that range. That is, the first item is the
actualBaseText of the given argument, and the second and third items are simply the
argument's fromState and its toState , respectively.
textObject
See Also
IndirectText , actualBaseText
addEventInterest
addEventInterest interestedobject, event, eventdispatcher
This handler adds the interestedObject to the objects interested in the event of the
eventDispatcher. This means that whenever the eventDispatcher gets the specified
event, it dispatches the event to the interestedObject .
Page 867
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a d d h a n d l e r d i a l o g
Example
Consider an rectangle, called StageMouseDownMonitor, that wants to catch the
mouseDown event on the Stage . You cannot define the mousedown handler of the Stage
because the Stage is not an object in your project and you cannot specialize the Stage by
making a new one. What to do? Well, just add your object to the eventInterests of the
Stage as follows:
addEventInterest StageMouseDownMonitor, 'mouseDown', Stage
See Also
addhandlerdialog
addHandlerDialog objlist
This function is used to bring up a dialog to add a handler to an object. It takes a single
argument and it brings up a dialog asking the user to create a handler for the specified
object. The user may enter any valid handler name and the default Script Editor will be
brought up for that handler.
Example
AddHandlerDialog of SuperRect
addparentdialog
addParentDialog objlist, parent
This function is used to bring up a dialog to add an object as a parent to one or more
objects. It takes two arguments. The first is an object or collection of objects. The second is
a potential parent. It displays a dialog asking the user if they wish to make the second
object a new parent of the first object. If the user chooses yes, then the parent is added to
each of the objects.
Example
addParentDialog SuperRect, BrowserComponent
Page 868
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a d d p o r t d i a l o g
addportdialog
addPortDialog prop, objlist
This function is used to bring up a dialog to add a port to the property of an object. It
takes two arguments, a symbol for property and an object. It displays a dialog asking the
user if they wish to add a port to the property of the object. The dialog has a popup to
choose the type of port. If the user chooses yes, then the port is added.
prop: This specifies the symbol of the property to have a port added.
objlist: This specifies the object or objects to have a port added.
Example
addPortdialog 'fillColor', SuperRect
addpropertydialog
addPropertyDialog objlist
with property
This function is used to bring up a dialog to add a property to one or more objects. This
function takes a single argument which can either be an object or a list of objects. It
displays a dialog asking the user if they wish to add a property to the object(s). The user
can type in any valid property name. If the user presses the ok button, the property will be
added to all of the objects.
objlist: This specifies the object or objects to get the new property.
[with property]: This can specify a default symbol to use as a property name
in the dialog. Note the user can change this within the dialog.
Example
AddPropertyDialog of SuperRect
align
align actorlist
with alignlocation
with resizing
with physical
with relativeactor
with boundsrect
This function is used to graphically align a set of actors in a specified area.
Page 869
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a l i g n m e n t O f B o u n d s To B o u n d s
The area in which the objects are tiled is specified by either a relativeActor or by a
boundsRect (note that if you specify a boundsRect , you can also specify whether this
to be physical or not).
actorList
[with alignLocation]: This specify how objects are aligned. This can be
'left' , 'top' , 'right' , 'bottom' , 'center' , 'topleft' ,
'topcenter' , 'topright' , 'centerleft' ,'centerright' ,
'bottomleft' , 'bottomcenter' , and 'bottomright' .
[with resizing]: If this is True , then the objects will be sized so that they fit
within the area specified. If this is set to False , then the top and left of
the area are used, and the objects may go past or be within the area.
[with physical]: See below.
[with relativeActor]: See below.
[with boundsRect]: See below.
Example
The following will push every item of inside the object to the object's left edge.
align my contents with relativeActor me with alignLocation 'left'
alignmentOfBoundsToBounds
alignmentOfBoundsToBounds boundingbox1, boundingbox2
Return type: { horizontalAlignment (a Number or False),
verticalAlignment (a Number or False) }
Given two bounding boxes, returns alignment argument values hz and vt such that
alignSizeToBounds (size of boundingBox1), boundingBox2
with horizontalAlignment hz with
verticalAlignment vt
yields boundingBox1 . (If both boxes are the same width, then the horizontal component
of the result from alignSizeToBounds will be the horizontal component of
boundingBox2 . Similarly for the vertical component.)
If the horizontal dimensions of the two boxes are identical, then horizontalAlignment
is 1/2. If either box is horizontally contained within the other, horizontalAlignment
is a number from 0 through 1 . 0 means that the left sides of the two bounding boxes are
the same, 1 means that the right sides of the two bounding boxes are the same, and an
intermediate value designates the relative position of the smaller width within the larger
width. If the widths of the two bounding boxes are the same but the left and right sides
are not the same, then horizontalAlignment is False . If none of the above cases
pertains, a number outside the range of 0 through 1 results.
The verticalAlignment is calculated similarly.
Page 870
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a l i g n S i z e To B o u n d s
See Also
alignmentOfBoundsToBounds , constrainSizeToAspectRatio ,
alignSizeToBounds , constrainBoundsToAspectRatio
alignSizeToBounds
alignSizeToBounds size, boundingbox
with horizontalalignment
with verticalalignment
Return type: { left (a Number), top (a Number), right (a Number),
bottom (a Number) }
Given a boundingBox , return the four values of a new bounding box of the given size ,
aligned to boundingBox as specified with the horizontalAlignment and
verticalAlignment arguments.
Example
alignSizeToBounds { 1, 2 } { 0, 0, 5, 5 } yields { 2, 4, 3, 6 }
alignSizeToBounds { 1, 2 } { 0, 0, 5, 5 } with
horizontalAlignment 0 yields { 0, 4, 1, 6 }
Page 871
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a l p h a b e t i c
See Also
alignmentOfBoundsToBounds , constrainSizeToAspectRatio ,
alignSizeToBounds , constrainBoundsToAspectRatio
alphabetic
alphabetic textorcharacter
This function returns True if every character in its argument is an alphabetic character,
and False otherwise. It is an error if the argument is not a character or a descendant of
Text .
textOrCharacter
Example
alphabetic ("abc")-- returns True
alphabetic ("ab2")-- returns False
alphabetic (the char "X")-- returns True
See Also
alphanumeric
alphanumeric
alphanumeric textorcharacter
This function returns True if every character in its argument is either alphabetic or
numeric, and False otherwise. It is an error if the argument is not a character or a
descendant of Text .
textOrCharacter
Example
alphanumeric ("ab2")-- returns True
alphanumeric ("ab2-2")-- returns False
alphanumeric (the char "3")-- returns True
See Also
alphabetic
Page 872
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a n a l y z e a c t o r s f o r s e l e c t i o n
analyzeactorsforselection
analyzeActorsForSelection thepointslist
with avoiding
with container
This function is used to analyze a user specified area of the screen in order to determine
what objects should be selected. It takes either a boundsrect or a set of points (e.g. the
values returned by a getshapefromuser call) and returns a list of four values. These four
values are described below.
The first value is the clicked actor. If the result was a click and not a box/lasso, this is the
object that was clicked on. Otherwise it returns False .
The second value is a list of the Contained Actors. This is an ordered list of lists. Each
sublist is a list of objects fully contained by the region. Each list represents a level of
containment in one actor. Thus each list is a list of all the actors fully surrounded at a
specific level in a specific actor. For Example: The first list is the list of actors which are
fully surrounded at the highest level. For every item in this first list there will be another
list of all the items inside because all of these items will be surrounded. There will also be
lists of objects which are contained by the halo but are not as high up in the containment
hierarchy as those in the first list, etc.
The third value is a list of the TouchedActors. This is an ordered list of lists in the same
form as (2) except the objects in the lists are ones that are touched in any way (partially or
fully) by the region defined.
The fourth value is the Lowest Fully Contained By Actor. This is the deepest actor which
fully contains the region. (There can be at most one of these)
This function takes an avoiding keyword which can specify an object or a list of objects
which are to be ignored when constructing these values.
ascii
ascii ch
This function returns the ASCII value its argument. The result is an integer. It is an error if
the argument is not a character or a single-character-long descendant of Text .
ch
Page 873
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a s h
Example
ascii ("A")-- returns 65
ascii (the char "B")-- returns 66
See Also
ash
ash Integer, count
This function shifts the given integer arithmetically left by count bit positions if count is
positive, or right by -count positions if count is negative. For left shifts, zero bits are
shifted in. It is an error if either of the arguments is not an integer.
integer
[count]
asin
asin radians
This function returns the arc sine of its argument. The result is in radians. It is an error if
the argument is not a number.
number
See Also
sin , cos , tan , asin , acos , atan , sinh , cosh , tanh , asinh , acosh , atanh
asinh
asinh radians
This function returns the hyperbolic arc sine of its argument. It is an error if the argument
is not a number.
number
See Also
sin , cos , tan , asin , acos , atan , sinh , cosh , tanh , asinh , acosh , atanh
Page 874
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
a t a n
atan
atan y, x
This function returns the arc tangent of its input. If a single argument is given, the input is
that argument; if two are given, the input is the first divided by the second (unless the
second is 0, in which case the positive or negative x-axis is indicated) and the signs of the
two numbers are used to derive quadrant information. The result is in radians. It is an
error if either of the arguments is not a number.
number
See Also
sin , cos , tan , asin , acos , atan , sinh , cosh , tanh , asinh , acosh , atanh
atanh
atanh radians
This function returns the hyperbolic arc tangent of its argument. It is an error if the
argument is not a number.
number
See Also
sin , cos , tan , asin , acos , atan , sinh , cosh , tanh , asinh , acosh , atanh
beep
beep opt-0, opt-1
This function plays the system beep sound. If no argument is given, it plays a single beep;
otherwise, the argument must be an integer specifying the number of beeps to play (if it is
less than 1 then no beep is played).
bound
bound sym
This function returns True if the global variable (or constant) named by the given symbol
exists and has a value, and False otherwise. It is an error if the argument is not a symbol.
Page 875
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b o u n d s R e g i o n O K
See Also
constant
boundsRegionOK
boundsRegionOK anactor
This functions informs the system that the boundsRegion of the actor in question has been
recomputed and it is now correct.
See Also
makeBoundsRegion of Actor.
browserHighlight
browserHighlight me
This function is usually called on activateText of a BrowserComponent . It checks to
see if its argument is in a browserPaper window, and if so, it uses the browserPaper's
highlighterHalo to surround itself (or its container if it is a picker of a textlist).
me
browserunhighlight
browserunhighlight me
This function is usually called on deactivateText of a BrowserComponent . It checks
to see if its argument is in a browserPaper window, and if so, it moves the
browserPaper's highlighterHalo offstage.
me
buildStandalone
buildStandalone pathname
with uiwindows
with creator
Page 876
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
b u i l d S t a n d a l o n e D i a l o g
pathname
[with build]
[with uiwindows]
buildStandaloneDialog
buildStandaloneDialog
with directory
with title
[with directory]: This takes a Sk8 file object which specifies the default
directory.
[with title]: This is the text used at the top of the dialog.
canDo
canDo handlerName, obj
If only the first argument, handlerName, is given this function returns True if there exists
any handler or function corresponding to that symbol, and False otherwise; if the second
argument, object, is also given it returns True if a handler of the given name is defined on
that object or any of its ancestors, and False otherwise.
Example
canDo ('fillColor', Rectangle)-- returns True
canDo ('beep')-- returns True
canLogIt
canLogIt
capsKeyDown
capsKeyDown
This function returns True if the Caps Lock key on the keyboard is currently held down,
and False otherwise.
See Also
Page 877
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c e i l i n g
ceiling
ceiling Number, divisor
This function converts its input to an integer by truncating toward positive infinity; that
is, the result is the smallest integer that is not smaller than the input. If a single argument
is given, the input is that argument; if two are given, the input is the first divided by the
second. It is an error if either of the arguments is not a non-complex number.
number (a Number)
[divisor] (a Number)
See Also
character
character thing
Coerces thing to a Character if possible. The given object must be a Character,
nonnegative integer corresponding to an ASCII character code, a String of length one, or
a Symbol whose name is a string of length one.
See Also
checkTimeValue
checkTimeValue timeValue
Raise an error if the given timeValue won't fit into a 32-bit number.
timeValue
clearprojectinterests
clearProjectInterests eventdispatcher, theproj
This function removes any objects in theProj from the event interests of the
eventDispatcher. It is called just before theProj is closed.
Page 878
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c l i p t o m a s k
eventDispatcher
theProj (a Project)
See Also
addEventInterests , makeEventInterestsHashTable .
cliptomask
clipToMask themask, thepaper
Set the clipping region of the current grafport to the given mask
Note: This function is dangerous, and should only be used in the body of a render
handler.◆
themask (a Mask)
thePaper: The "thePaper" argument that is passed to the render handler
should be used for this argument.
commandKeyDown
commandKeyDown
This function returns True if the Command key on the keyboard is currently held down,
and False otherwise.
See Also
compactSK8
compactSK8
This handler clears references to everything in the recycled list.
See Also
complex
Complex realPart, imagPart
This function creates and returns a complex number from realPart and imagPart.
Page 879
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o n s t a n t
realPart (a Real)
[imagPart] (a Real)
See Also
constant
constant sym
This function returns True if there is a global constant corresponding to the given symbol,
and False otherwise. It is an error if the argument is not a symbol.
See Also
bound
constrainBoundsToAspectRatio
constrainBoundsToAspectRatio aspectratio, boundingbox
with horizontalalignment
with verticalalignment
with oldbounds
with fitoutside
Return type: { newWidth (a Number), newHeight (a Number) }
If the fitOutside argument is False , returns a possibly-smaller bounding box with the
desired aspect ratio that will just fit within the given boundingBox ; othersize, returns a
possibly-larger bounding box that will minimally cover the original size. The resulting
boundingBox is aligned to the given boundingBox as specified with the
horizontalAlignment and verticalAlignment arguments or relative to
oldBounds .
Page 880
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o n s t r a i n S i z e To A s p e c t R a t i o
See Also
alignmentOfBoundsToBounds , constrainSizeToAspectRatio ,
alignSizeToBounds , constrainBoundsToAspectRatio
constrainSizeToAspectRatio
constrainSizeToAspectRatio aspectratio, size
with fitoutside
Return type: { newWidth (a Number), newHeight (a Number) }
Given a rectangle size, returns a possibly-smaller size of the desired aspect ratio that will
just fit within it. If the fitOutside argument is not False , then returns a
possibly-larger size that will minimally cover the original size.
See Also
alignmentOfBoundsToBounds , constrainSizeToAspectRatio ,
alignSizeToBounds , constrainBoundsToAspectRatio
Page 881
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o n t a i n s
contains
contains Collection, item
with test
with exactmatch
Returns True if the item occurs anywhere in the given collection, and False otherwise.
Note: The behavior of contains is entirely determined by the positionOfItem
handler; contains returns True if and only if positionOfItem , called with the same
arguments, returns a non-False value. Thus, its behavior can be specialized for a given
collection by defining a positionOfItem handler on that collection.◆
collection (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
positionOfItem , position
controlKeyDown
controlKeyDown
This function returns True if the Control key on the keyboard is currently held down, and
False otherwise.
See Also
copyresourcetoproject
copyResourceToProject theproj, thehandle, resourcetype
This low level function writes the handle to the resource fork of the project's file. The
resourceId of the handle in the file is returned. This is a useful function if you will be
writing your own translators.
theproj (a Project)
thehandle (a handle)
resourceType (an osType): The resource type of the handle that is about to be
written to the resource fork. Always a string of 4 characters like "PICT"
or "snd " .
Page 882
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c o p y Te x t P r o p e r t i e s
See Also
importFromResource , import .
copyTextProperties
copyTextProperties dest, src
This function copies the text properties from the source object (the SECOND argument) to
the properities of the destination object (the FIRST argument). The properties copied are
'textFont', 'textColor', 'textSize', 'textOffset', 'textLocation' and 'textStyle'.
Example
copyTextProperties DestinationActor, SourceActor
cos
cos radians
This function returns the cosine of its argument. The argument is in radians. It is an error
if the argument is not a number.
number
See Also
sin , cos , tan , asin , acos , atan , sinh , cosh , tanh , asinh , acosh , atanh
cosh
cosh radians
This function returns the hyperbolic cosine of its argument. It is an error if the argument is
not a number.
number
See Also
sin , cos , tan , asin , acos , atan , sinh , cosh , tanh , asinh , acosh , atanh
Page 883
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c u r r e n t C l i p To M a s k
currentClipToMask
currentClipToMask themask, thepaper
Copies the current clip region to the mask.
themask (a Mask)
thePaper: The surface whose current clip we are interested in. The
"thePaper" argument that is passed to the render handler should be
used for this argument.
See Also
clipToMask .
currentCondition
currentCondition
When a condition is raised, this function will return its value.
Note: There used to be a global variable with this name, currentCondition, but in a
multithreaded system, one can have several conditions raised during the same period.
Using a function to get the current condition value relative to the current thread prevents
confusion here.◆
See Also
currentEventKey
currentEventKey
This is the current character associated with the current event. For example, if a keydown
event is being processed, this will return the key pressed. Can be used by eventMode
objects in creating custom event processing.
Example
The following is a handler for an EventMode object which will dispatch key events
regularly.
Page 884
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
c u r r e n t E v e n t M o d e s
on HandleKeyDown of me (a superEventMode)
set the key to the currentEventKey()
if key and currentEventWindow() then
set the keymaster to the keytarget of the currentEventWindow
if keymaster then keydown(keymaster, key)
end if
end HandleKeyDown
currentEventModes
currentEventModes
This function returns the stack of current event modes. The first mode on the stack is the
active mode.
currentFloatingWindow
currentfloatingwindow
Returns the current floating window. This is the last floating window that was selected
by the user (clicked on).
See Also
currentWindow.
currentInvokableConditionResponses
currentInvokableConditionResponses
Returns a list of all the condition responses that are currently invokable, based on the
currentCondition and current state of the system.
See Also
currentWindow
currentWindow
Returns the current top level actor. This is the last window that the user has clicked on.
See Also
currentFloatingWindow.
Page 885
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d a t e S t r i n g To A b s o l u t e Ti m e
dateStringToAbsoluteTime
dateStringToAbsoluteTime thestring
Given a string in the format of a date, this function will return the number of seconds
from midnight, January 1, 1904. This is the inverse function of
absoluteTimeToDateString .
Example
dateStringToAbsoluteTime "1/1/94"-- returns 284022720
deleteMovieFile
deleteMovieFile theFile
Return type: none
Use this function to delete any file that may be open via QuickTime. This includes files
that have "MooV" resources, data-fork-only movie files, "AIFF" files, or anything else that
can be opened using the QuickTime subsystem.
If you use normal file system calls touch a file, and QuickTime has the file open, you'll
cause trouble.
theFile (a File)
See Also
IM-QuickTime, p. 2-100.
dispatchToInterestedObjects
dispatchToInterestedObjects eventdispatcher, event, args
This function is called when the eventDispatcher gets the event in order to dispatch it to
the objects interested in it. If you create an event dispatcher object you will need to call
this function when an event you support for dispatching takes place.
Page 886
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d i s p o s e d i a l o g
Example
Let us create a custom event dispathing object. You should note before we start that this
event dispatching mechanism is provided for strange cases in which normal handler
definition will not work (eg. defining handlers for objects in another project). With that
out of the way we may continue...
In this example you can see what the Stage object had to go through in order to be able
to dispatch events. First we added the eventInterests property and initialized it to
contain a special data structure that keeps track of the event interests.
addProperty Stage, 'eventInterests'
set the eventInterests of the Stage to
makeEventInterestsHashTable()
Now we need to choose the events that will support dispatching. Let us make
mouseDown supported. For that we define the mouseDown handler of the Stage as
follows:
on mousedown of me (a Stage)
dispatchToInterestedObjects me, 'mouseDown'
end mousedown
And now, each time the mouseDown event takes place, all the interested objects will get
mouseDown called on them.
See Also
addEventInterest , removeEventInterest .
disposedialog
disposeDialog objects
with textfont
with textsize
with width
with height
with h
with v
Given an object or a list of objects, this function will display a dialog asking “Do you wish
to clear references to YourObject?” Two buttons are displayed: “Yes” and “No”. If the
“Yes” button is selected the object(s) will be made ready for garbage collection. Note that
it does this by setting objectnames to false, removing the item's contents, removing the
item from its container, and removing the items from the knownchildren list.
Page 887
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d i s p o s e M e m
objects: This is the object or list of objects to be made ready for garbage
collection.
[with textFont]: This takes a font and specifies the font used in the message
and the buttons.
[with textSize]: This takes a number and specifies the size of the font used in
the message and the buttons.
[with width]: This specifies the width of the dialog, it defaults to 100.
[with height]: This specifies the height of the dialog, it defaults to 350
[with h]: h and v specify the initial location of the dialog. This defaults to
center of the main monitor.
[with v]: h and v specify the initial location of the dialog. This defaults to
center of the main monitor.
[with cancel]
disposeMem
disposeMem a-macptr
Advanced users sometimes call code written in languages other than SK8 Script. Such
code is called "foreign" code. Sometimes foreign code manipulates data which must not
be moved and must be explicitly allocated and freed. In general it is tedious and error
prone to do this. However, if you must bit twiddle and feel that you really know what
you are doing, you can allocate and deallocate static memory explicitly. This function lets
you deallocate memory which has been allocated by use of one of the functions
newMemPointer or newMemHandle. Note that such memory operations are unsafe. You
can easily crash your machine if these memory management functions are used as you are
stepping outside of the safety of the SK8 system.
foreignMem
Example
disposeMem( aMemHandleOrMemPointer )
See Also
newMemPointer, newMemHandle
Page 888
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d i s t r i b u t e
distribute
distribute actorlist
with how
with sizerelative
with relativeactor
with boundsrect
with physical
This function is used to distribute a set of actors in a specified area. The area in which the
objects are tiled is specified by either a relativeActor or by a boundsRect (note that if
you specify a boundsrect , you can also specify whether this to be physical or not).
Example
The following will spread out every item of inside the object from left to right, relative to
the size of each of the contents.
distribute my contents with how 'h' with sizeRelative with
relativeActor me
dollarString
dollarString num
Given a number, this function returns a string representing that number in dollar format
(preceded by a dollar sign and including two decimal places). It is an error if the argument
is not a number.
dragActors
dragActors actorlist, xoffset, yoffset, constrainingrect
Drags the outline of multiple actors. Returns a list of two numbers specifying how much
the actor were moved (but does not change the location of any actor).
Page 889
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d r a g R u b b e r b a n d
See Also
drag .
dragRubberband
dragRubberband
with hanchor
with vanchor
with width
with height
This function lets the user specify the endpoints of a line by direct manipulation. The
user controls the endpoint of the line with the mouse while the startpoint is fixed to the
values in the hAnchor and vAnchor arguments.
This function should be called from a mouseDown handler.
[with hanchor] (an Integer): The horizontal physical position of the line's
fixed point.
[with vanchor] (an Integer): The vertical physical position of the line's fixed
point.
[with width] (an Integer): The width of the pen that will draw the line.
Defaults to 3 pixels.
[with height]: The height of the pen that will draw the line. Defaults to 3
pixels.
See Also
endPoints of LineSegment .
drawXORFrame
drawXORFrame ll, tt, rr, bb
with pensize
with grayline
This will draw a rectangular XOR outline (reversing the pixels under the outline) on the
screen.
Page 890
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
d r a w X O R L i n e
Example
DrawXORFrame (0, 0, 400, 400)
drawXORLine
drawXORLine startx, starty, endx, endy
with size
with grayline
Draws a line in XOR mode (reversing the pixels under the line) from the starting
coordinates to the ending coordinates.
Example
drawXORLine (0, 0, 400, 400) with grayline with size {1,1}
drawXORRectangle
drawXORRectangle ll, tt, rr, bb
with grayline
Draw an XOR rectangle (i.e. reverse the pixels inside the rectagle)
Page 891
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e d i t H a n d l e r
Example
DrawXORRectangle (0, 0, 400, 400)
editHandler
editHandler handlerproject, handlerName, handlerobject,
handlerqualifier, version, editorprototype, boundsRect
Given a project, a handler name and, optionally, an object, this function brings up a
handler editor (a descendant of ScriptEditorWindow ) for the handler described by the
arguments. If there is already an open editor for the handler (as determined by
findHandlerEditor ) then that editor is simply brought to the front.
If the handler does not yet exist, an editor with a template for the new handler is brought
up. If the handler already exists but its script is not available, a dialog box to that effect is
displayed, offering the option of redefining the handler from scratch.
Note: This function is an alternative interface to the same functionality provided by the
editHandlerObject function, except that this interface allows for the creation of new
handlers (in addition to accessing existing handlers).◆
Example
editHandler (SampleProject, 'sampleFunction')
See Also
Page 892
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e d i t H a n d l e r D i a l o g
editHandlerDialog
editHandlerDialog obj
with handlername
with qualifier
with project
Given an object and an optional keyword handlerName specifying the handler name as a
string, this will bring up handler editor window. If the object is unnamed, it will prompt
for the user for a name first. If the handlername is not specified, the addhandlerdialog
is brought up to get a handlername. If the handler already exists, and no text is available
for that handler, then the user is given a warning.
Example
This will prompt user for a handler name then bring up an editor:
editHandlerDialog superOval
This will bring up an editor:
editHandlerDialog superOval with handlerName "mouseUp"
editHandlerObject
editHandlerObject h
with editorprototype
This function brings up a handler editor (a descendant of ScriptEditorWindow ) for the
given handler. If there is already an open editor for the handler (as determined by
findHandlerEditor ) then that editor is simply brought to the front. If the script for the
handler is not available, a dialog box to that effect is displayed, offering the option of
redefining the handler from scratch.
Note: This function is an alternative interface to the same functionality provided by the
editHandler function, except that this interface only provides access to existing
handlers (it does not allow for the creation of new handlers).◆
Example
editHandlerObject (item 1 in CircleButton's localHandlers)
Page 893
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e d i t H a n d l e r O b j e c t D i a l o g
See Also
editHandlerObjectDialog
editHandlerObjectDialog handlerobj
with obj
Given a handler object, this will call editHandlerDialog with all of the arguments
filled in from the object.
evaluateScriptCommand
evaluateScriptCommand targetproject, commandscript
with warnings
Given a targetProject in which to perform the evaluation and string containing a
script command, this function evaluates the command. If there is a syntactic error in the
command, a ScriptSyntaxError is raised; otherwise the result of evaluating the
command is returned.
If the warnings argument is True (the default) then warnings regarding local variable
usage in any function or handler defined in the command may be sent to the systemLog .
targetProject
commandScript
[with warnings]
See Also
evaluateScriptExpression
evaluateScriptExpression targetproject, exprscript
Given a targetProject in which to perform the evaluation and string containing a
script expression, this function evaluates the expression. If there is a syntactic error in the
expression, a ScriptSyntaxError is raised; otherwise the result of evaluating the
expression is returned.
Page 894
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e v a l u a t e S c r i p t H a n d l e r
targetProject
exprScript
See Also
evaluateScriptHandler
evaluateScriptHandler targetproject, handlerscript
with warnings
with versionid
with documentation
with outerglobals
with outerlocals
with selfstoring
Given a targetProject in which to perform the evaluation and string containing a
script handler or function definition, this function evaluates the definition. If there is a
syntactic error in the definition, a ScriptSyntaxError is raised; otherwise the result of
evaluating the definition is returned.
If the warnings argument is True (the default) then warnings regarding local variable
usage in the given function or handler definition may be sent to the systemLog .
The outerGlobals and outerLocals arguments may be used to indicate to the
evaluator whether a particular undeclared variable in the definition should be assumed to
be a local variable or a global variable. Each of these arguments, if given, must be lists of
symbols. A symbol in either of these lists is ignored if it does not appear as a variable in
the handler definition or if it does appear but is explicitly declared local or global.
If the selfStoring argument is True (the default) then the definition will be written
into the targetProject 's project file if the function or handler is succesfully evaluated
and activated.
The documentation argument, if supplied, should be a string containing documentation
to associate with this function or handler. This argument is ignored if the selfStoring
argument is False .
The versionID argument, if supplied, should be an integer representing a date and time
in universal time encoding; if this argument is not supplied, the current time will be used
as the version ID. This argument is ignored if the selfStoring argument is False .
Page 895
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e v e n
targetProject
handlerScript
[with warnings]
[with versionID]
[with documentation]
[with outerGlobals]
[with outerLocals]
[with selfStoring]
See Also
even
even int
This function returns True if its argument is even (divisible by 2), and otherwise False .
It is an error if the argument is not an integer.
Example
even (2)-- returns True
9 is even-- returns False
See Also
odd
eventActor
eventActor
Returns the Actor that is currently receiving events from the event system. This is usually
the actor under the mouse.
Example
Since events are propagated up the containment hierarchy, it is common to take into
account whether an actor is the event actor before following a course of action. What we
are in effect doing, with this variable is distinguishing between two cases: when an actor
is the original recipient of an event and when it is not.
Page 896
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e v e n t H
To illustrate the problems that arise from this consider a Scroller called
NastyScroller and its ScrollerDownArrow. On mousedown , the downArrow passes
the event to its container to let it know that a mouseDown event has happened within it.
When the inherited handler returns, the down arrow does its usual thing (scroll the
scroller down while the mouse is down). Consider the following handler:
on mouseDown of me (a NastyScroller)
drag me
end mouseDown
If we now press the mouse on the scroller's down arrow, NastyScroller gets a
mouseDown event at which point it takes control of the mouse (drag returns when the
mouse is up). So, when we get to what we really wanted to do (scroll the scroller) the
mouse is up and nothing happens. That is why we should distinguish between the two
cases above.
The eventActor function comes to the rescue.
on mouseDown of me (a NastyScroller)
if eventActor() = me then
drag me
end if
end mousedown
At this point we might consider changing the objectName of NastyScroller to
"NiceWellBehavedGoodCitizenScroller" .
See Also
eventH
eventH
Returns the horizontal physical position of the last event.
See Also
eventsDelegated
eventsDelegated interestedobject, eventdispatcher
Returns a list of all the events that the interestedObject requests from the
eventDispatcher.
interestedObject (an Object): The object who asks the dispatcher for events.
eventDispatcher (an Object): The object that is nice enough to dispatch some
of its events to interested parties.
Page 897
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e v e n t Ti m e
See Also
eventTime
eventTime
Returns the time at which the last event took place. The number returned is, actually, the
number of ticks since the machine was restarted. You can compare this value to the
current time by asking for the ticks of Now.
See Also
eventV
eventV
Returns the vertical physical location of the last event.
See Also
exitModalState
exitModalState value
You can call this function to leave a modal state that was entered using the
enterModalState handler of eventMode .
See Also
enterModalState of eventMode .
exp
exp Number
This function returns e raised to the power given by the argument, where e is the base of
the natural logarithms.
number
Page 898
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
e x p t
See Also
expt , log
expt
expt base-number, power-number
This function returns baseNumber raised to the power powerNumber. It is an error if
either of the arguments is not a number.
baseNumber
powerNumber
See Also
exp , log
fillRegionOK
fillRegionOK anactor
This functions informs the system that the fillRegion of the actor in question has been
recomputed and it is now correct.
See Also
makeFillRegion of Actor.
findCurrentEventActor
findCurrentEventActor
Returns the actor currently under the mouse. Note that the mouseSensitivity
determines whether an actor can be seen by this function.
findDropObject
findDropObject x, y
with avoiding
Given x and y coordinates on the Stage, it returns the deepest thing hit which accepts
drops (or the stage if none is found).
Page 899
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
fi n d E x p o r t T r a n s l a t o r
See Also
findCurrentEventActor.
findExportTranslator
findExportTranslator source, destination
Returns all the translators that canExport from the source to the destination .
source
destination
See Also
findFileInProject
findFileInProject fromfile, inproj
This function returns a file object in the project inProj that points to the same file that
fromFile points to. If fromFile is an object in project inProj, it is returned. Otherwise a
new file object is created.
fromFile (a File)
inProj (a Project): The project in which we want a file object pointing to the
file in fromFile.
findHandlerEditor
findHandlerEditor handlerproject, handlerName, handlerobject,
handlerqualifier
Given a project, a handler name and, optionally, an object, this function returns the
descendant of ScriptEditorWindow currently open and displaying that handler, if
there is such a window, and False otherwise.
Page 900
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
fi n d I m p o r t T r a n s l a t o r
Example
findHandlerEditor (SampleProject, 'mouseUp', FunButton)
findHandlerEditor (SampleProject, 'sillyFunction')
See Also
findImportTranslator
findImportTranslator source, destination, finaldestination
Returns the first translator it can find that canImport the source into the destination
and can then produce the finalDestination .
source
destination
[finalDestination]
See Also
findObject
findObject name
with fromproject
with project
returns object accessible from project
Page 901
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
fi n d S e l e c t e d A c t o r s
findSelectedActors
findSelectedActors thepointslist
with avoiding
with container
This function is used to find a set of selected items from a point list. It makes use of the
analyzeActorsForSelection function to find the set of actors which are surrounded
by the selection area. It takes an avoiding keyword to specify a list of objects to be
ignored in the computation of selection.
Example
on mouseDown of me (a SelectingManiac)
--- The following has the user draw out an arbitrary region.
set the lassoPoints to getShapeFromUser (Polygon)
--- The following generates a list of actors based on the points.
set the victims to findSelectedActors (lassoPoints)
--- The following has the tagged selectionDots select the
surrounded actors
set the selectedItems of my SelectionPoints to the victims
end mouseDown
See Also
analizeActorsForSelection .
findSelectedActorsGrow
findSelectedActorsGrow thepointslist
with avoiding
with container
This function is used to find a set of selected items from a point list. It makes use of the
AnalyeActorsForSelection function to find the set of actors which are touched by
the selection area. It takes a avoiding keyword to specify a list of objects to be ignored in
the computation of selection.
Page 902
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
fi n i s h N e w M a s k
Example
on mouseDown of me (a SelectingManiac)
--- The following has the user draw out an arbitrary region.
set the lassoPoints to getShapeFromUser (Polygon)
--- The following generates a list of actors based on the points.
set the victims to findSelectedActorsGrow (lassoPoints)
--- The following has the tagged selectionDots select the
surrounded actors
set the selectedItems of my SelectionPoints to the victims
end mouseDown
finishNewMask
finishNewMask dstmask, thepen
This function closes the region opened by the StartNewMask function.
dstmask (a Mask)
thePen (a Pen): The pen object that was used to accumulate the mask in.
Should be the same pen object that was used in the call to
startNewMask .
See Also
StartNewMask .
floor
floor Number, divisor
This function converts its input to an integer by truncating toward negative infinity; that
is, the result is the largest integer that is not larger than the input. If a single argument is
given, the input is that argument; if two are given, the input is the first divided by the
second. It is an error if either of the arguments is not a non-complex number.
number (a Number)
[divisor] (a Number)
See Also
forceExitCurrentMode
forceExitCurrentMode
This exits the current Event Mode (if any) with extreme prejudice.
Page 903
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
f o r c e G a r b a g e C o l l e c t i o n
forceGarbageCollection
forceGarbageCollection
frameRegionOK
frameRegionOK anactor
This functions informs the system that the frameRegion of the actor in question has been
recomputed and it is now correct.
See Also
makeFrameRegion of Actor.
functional
functional sym
This function returns True if there is an active function or handler associated with the
given symbol, and False otherwise. It is an error if the argument is not a symbol.
gcd
gcd integers
This function returns the greatest common divisor of all the arguments, which must be
integers. The result of gcd is always a non-negative integer. If only one argument is given,
its absolute values is returned. If no arguments are given, gcd returns 0
Example
gcd (-91, 49)-- returns 7
gcd (26, 78, 4)-- returns 2
See Also
lcm
Page 904
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
g e t a n s w e r f r o m u s e r
getanswerfromuser
getAnswerFromUser message
with textfont
with textsize
with width
with height
with h
with v
with oktext
with canceltext
with defaultanswer
with allowspaces
with allowreturns
with allowemptystrings
with system
This function is used to bring up a dialog used for getting a string from user. It takes one
argument which is the message which appears, and it features a type in field where the
user can enter a string.
Note that the buttons will resize to accomodate the okText and the cancelText .
getFreehandFromUser
getFreehandFromUser startx, starty
Page 905
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
g e t F r o m U s e r D i a l o g
startX
startY
getFromUserDialog
getFromUserDialog obj
with textfont
with textsize
with width
with height
with h
with v
with title
with swatches
with project
with multiplevalues
with cancelstring
with buttonstring
Given a Sk8 object, this function will display a dialog with three buttons
(“Cancel”,“New”,“Select”) and a (finder-like) hierarchical list of the object and its children
for you to select. It returns the selected object. This is used by the GetFromUser
functionality.
Page 906
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
g e t F u n c t i o n N a m e C o m p l e t i o n s
getFunctionNameCompletions
getFunctionNameCompletions name
with completion
with project
with case
with functions
with matches
if you have the start of a function name, this function will tell you what completions are
possible
name
[with completion]
[with project]
[with all]
[with case]
[with functions]
[with matches]
getGlobalNameCompletions
getGlobalNameCompletions name
with completion
with project
with case
with matches
if you have the start of a global name,this function will tell you what completions are
possible
name
[with completion]
[with project]
[with all]
[with case]
[with constant]
getHandlerNameCompletions
getHandlerNameCompletions name
with completion
with strict
with handlers
with matches
with project
Page 907
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
g e t H a n d l e r s
if you have the start of a name of a handler, this function will tell you what completions
are possible
name
[with completion]
[with strict]
[with handlers]
[with matches]
[with project]
[with all]
getHandlers
getHandlers objlist, displaystyle
with showsprivates
objlist
displaystyle
[with showsprivates]
getObjectNameCompletions
getObjectNameCompletions name
with completion
with project
with all
with case
with objects
with matches
If you have the start of an object name, this function will tell you what completions are
possible.
name
[with completion]
[with project]
[with all]
[with case]
[with objects]
[with matches]
Page 908
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
g e t p r o p e r t y n a m e c o m p l e t i o n s
getpropertynamecompletions
getPropertyNameCompletions name
with completion
with matches
with objects
with case
with project
if you have the start of a name of a property, this function will tell you what completions
are possible
name
[with completion]
[with matches]
[with objects]
[with case]
[with project]
[with all]
getscrap
getScrap thetype
Reads the system scrap looking for a handle of the type specified. The handle is returned.
getvalue
getValue property, obj
Gets the value of a property (without calling the actual getter handler).
getValueFromUser
getValueFromUser obj, prop
with relativeactor
obj
prop
[with relativeActor]
Page 909
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
h a n d l e r A r g u m e n t s S t r i n g
handlerArgumentsString
handlerArgumentsString handlerobj
with declaration
with call
with primaryargument
with setterargument
This function returns a string representing the arguments that the given function or
handler object accepts. By default the argument sequence is represented in its simplest
form.
If the declaration argument is True (the default is False ) then the argument sequence
is represented in a form suitable for use in a function or handler definition. This argument
is ignored if the call argument is True .
If the call argument is True (the default is False ) then the argument sequence is
represented in a form suitable for use as the argument list in an expression that calls to the
given function or handler.
The primaryArgument and setterArgument arguments, when used in conjunction
with the call argument, control whether the primary argument (if there is one) and the
setter argument (if there is one) are included in the string. Both default to True . These
arguments are ignored if the call argument is False .
handlerObj
[with declaration]
[with call]
[with primaryArgument]
[with setterArgument]
icl8ToCicn
icl8tocicn sourcefile
with destinationfile
with selectedids
This function converts resources of type "icl8" into "cicn" resources which can then be
imported into SK8. Notice that the importing is a separate step that has nothing to do with
this function. This function is provided as a utility to allow people to make use of the vast
number of icons that have been created and stored using the icon family resource types
("ICN#", "icl8", etc.)
The name and ids of every resource is preserved.
Page 910
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i m a g P a r t
sourceFile (a File): The file that contains the "icl8" resource to be translated
into "cicn" resources.
[with destinationFile] (a File): If specified, should be the file where the "cicn"
resources should go. If the file does not exist it is created. If this
argument is False , the new resources are placed in the sourceFile.
[with selectedIds]: A list of integers or False . With this argument we can
specify which resources to be translated. If this argument is not
specified, every resource of type "icl8" is translated.
Example
Suppose that you get a file full of icons that you want to use in your SK8 project. You try
import them with the MediaBrowser but find out that SK8 does not "see" any of the icons.
This might be because the icons you got are stored in the "icon family" format. You need to
turn these icons into "cicn" resources before SK8 will be able to deal with them.
The first step is to call this function to get this done. Assuming the iconFile is the file
containing the icons, we type:
icl8ToCicn iconFile
Now the icons are translated into "cicn" resources which have been saved into the same
file (iconFile). We can now import these icons using the MediaBrowser in the usual way.
imagPart
imagPart Number
Returns the imaginary part of the given number.
number (a Number)
See Also
importTranslatorsApplicable
importTranslatorsApplicable source
Returns all the translators that canImport from the source.
See Also
Page 911
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
i n f o S t r i n g F o r I d e n t i fi e r
infoStringForIdentifier
infoStringForIdentifier sym
Returns a string containing a description of any definitions associated with the given
symbol (e.g. global variable or constant definition, function or handler definition).
Note: This function is used to get the "help text" for SK8's help balloons when they're
applied to identifiers in any script input fields (descendants of ScriptEditText ).◆
sym (a Symbol)
initializerArgument
initializerArgument initializerarguments, argumentsymbol
with default
with use
Returns a given keyword argument's value from the initializerArguments, or the default
value if that argument is not found. If the use argument is True , marks the argument as
used (so that it will be ignored by processUnusedInitializerArguments ).
See Also
intersectionOf
intersectionOf list1, list2
list1
list2
Page 912
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l a y o u t D i a l o g
layoutDialog
layoutDialog actorlist
with location
with Label
actorList
[with location]
[with label]
lcm
lcm Integer, more-integers
This function returns the least common multiple of its arguments, which must be integers.
The result of lcm is always a non-negative integer. If only one argument is given, its
absolute value is returned.
int
[[moreIntegers]*] (an Integer)
Example
lcm (14, -35)-- returns 70
lcm (1, 2, 3, 4, 5)-- returns 60
See Also
gcd
length
length collection
Returns the number of items in the given collection.
Note: The behavior of length is entirely determined by the numItems handler. Thus, its
behavior can be specialized for a given collection by defining a numItems handler on that
collection.◆
collection (a Collection)
See Also
numItems
Page 913
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l i s t
list
list arguments
loadFilePhysicalName
loadFilePhysicalName
loadForeign
loadForeign loadspec, pathnamestring
The loadForeign function is used to load foreign binary (compiled) code into the SK8
environment. This allows foreign functions to be defined which access this code. Note
that no "library searching" is done. It is assumed that a library manager has already been
invoked to package all required code into the designated load module.
loadSpec
pathnameString
Example
loadForeign( Mac68KMPWCLoadSpec, "myCTestLib.o" )
See Also
Mac68KMPWCLoadSpec , Mac68KPascalLoadSpec
loadScriptFile
loadScriptFile myfile
with verbose
with project
with inproject
with console
with warnings
This function loads a file containing SK8Script commands and handler/function
definitions. It provides an alternate way of retrieving SK8 projects or components for
those who prefer textual editing in their favorite editors, like GNU emacs.
Page 914
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l o a d S c r i p t s
Example
loadScriptFile "MyDisk:MyScriptFile"
See Also
loadScripts
loadScripts files
with project
with verbose
with inproject
with skip
with console
with warnings
This function loads a series of files containing SK8Script commands and handler/function
definitions.
Note: This function is an alternative interface to the same functionality provided by the
loadScriptFile function, except that this interface allows several files to be specified at
once.◆
Example
loadScripts {"MyDisk:ScriptFile1", "MyDisk:ScriptFile2"}
See Also
log
log Number, base
This function returns the logarithm of number in the base base , which defaults to e, the
base of the natural logarithms. It is an error if either of the arguments is not a number.
Page 915
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
l o g C a l l s
number (a Number)
[base] (a Number): Default is e.
See Also
exp , expt
logCalls
logCalls handlerorname, Object, qualifier
handlerOrName
object
qualifier: Obsolete! Should always be False !
logObjectString
logObjectString obj
with project
This function handles printing the object's name to the current output stream. The ouput
is guaranteed to be readable as a SK8Script object identifier.
obj: the object whose name you want to print onto the ouptut stream
[with project]
See Also
lowercase
lowercase textorcharacter
Returns a copy of the given argument with all of its characters coerced to lowercase. It is
an error if the argument is not a descendant of Text or Character.
textOrCharacter
See Also
uppercase
Page 916
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a c C h o o s e D i r e c t o r y D i a l o g
macChooseDirectoryDialog
macChooseDirectoryDialog
with directory
with project
This function will display a standard Macintosh dialog for selecting a directory, i.e. a
Macintosh folder. It returns a file object.
[with directory]: This takes a SK8 file object which specifies the default
directory.
[with project]: The project of the returned file object.
macChooseFileDefaultDirectory
macChooseFileDefaultDirectory
with project
This function returns the system's default directory. On a Macintosh, this is the last
directory from which a file was chosen. It returns a file object.
macChooseFileDialog
macChooseFileDialog
with directory
with project
with macfiletype
with macfilecreator
with test
with files
with directories
with buttonstring
This function brings up the standard Macintosh Open File Dialog. It returns a file object
pointing to the file the user has chosen.
[with directory]
[with project]
[with macfiletype]: This specifies the file type to filter by. Note this must be a
four letter string, e.g. "TEXT" , or False .
[with macfilecreator]
[with test]
[with files]
[with directories]
[with buttonstring]
Page 917
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a c C h o o s e N e w F i l e D i a l o g
macChooseNewFileDialog
macChooseNewFileDialog
with directory
with prompt
with buttonstring
with project
This function brings up the standard Macintosh New File Dialog. It returns a file object
to the potential new file.
[with directory]
[with prompt]
[with buttonstring]
[with project]
macCopyResources
macCopyResources sourcefile, destinationfile, resType, idlist
This function copies an arbitrary collection of resources of a given type from one file to
another. The copy preserves the ids of the resources. If a collision happens, old resources
sharing ids with new resources are overwritten. If the destinationFile does not exist, one is
created.
macGetAnswerFromUser
macGetAnswerFromUser message
with defaultanswer
with width
with height
with top
with left
with oktext
with canceltext
with allowemptystrings
This function brings up a Macintosh dialog used for getting a string from user. It takes one
argument which is the message which appears, and it features a type in field where the
user can enter a string.
Page 918
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a c M e s s a g e To U s e r
message
[with defaultanswer]
[with width]
[with height]
[with top]
[with left]
[with oktext]
[with canceltext]
[with allowemptystrings]
macMessageToUser
macMessageToUser message
with oktext
with width
with height
with top
with left
This function brings up a Macintosh dialog for giving a message to the user. It takes one
argument which is the message which appears, and it has a single OK button.
message
[with oktext]
[with width]
[with height]
[with top]
[with left]
macSelectFromCollectionDialog
macSelectFromCollectionDialog candidatelist
with title
with multiplevalues
with buttonstring
This function takes a collection as an argument and displays a Macintosh dialog with a
scrolling list of the elements of the collection. There are two buttons: a “select” button and
a “cancel” button. If the the users makes a choice and selects okay, it returns the collection
item they selected.
Page 919
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a c Ye s O r N o D i a l o g
macYesOrNoDialog
macYesOrNoDialog message
with width
with height
with top
with left
with yestext
with notext
with canceltext
This function brings up a Macintosh dialog for getting a yes or no answer from the user. It
takes a single argument which is the string displayed in the dialog. There are three
buttons in the dialog: “Yes”, “No,” and “Cancel”.
mainMonitorCenter
mainMonitorCenter
This function returns the stage coordinates (as a list of two numbers) for the center of the
system's main monitor.
makeEventInterestsHashTable
makeEventInterestsHashTable
Creates the data structure required to store event interests.
See Also
mapallobjects
mapallobjects function
mapAllObjects is a function which maps a function over all objects currently loaded in
SK8 (this includes the object of SK8, of the User Interface, and of any other projects
currently loaded.
Page 920
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a s k b o t t o m
maskbottom
maskBottom amask
Returns the coordinates of the mask's bottom.
amask (a Mask)
maskboundsrect
maskBoundsRect amask
Returns the mask's boundsrect.
amask (a Mask)
maskcopy
maskCopy src, dst
Copies the src mask into the dst mask.
src (a Mask)
dst (a Mask)
maskdifference
maskDifference srca, srcb, dest
Sets the destination mask to the difference between the two source masks.
srca (a Mask)
srcb (a Mask)
dest (a Mask)
maskEmpty
maskEmpty amask
Returns whether the mask describes the empty region. The maskBoundsRect of an
empty mask is {0,0,0,0} .
Page 921
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a s k E q u a l
aMask (a Mask)
See Also
maskBoundsRect .
maskEqual
maskEqual maska, maskb
Returns whether the two masks are equal (they describe the same area).
maskA (a Mask)
maskB (a Mask)
maskinset
maskInset themask, h, v
Inset the mask object's region by the given horizontal and vertical amounts.
maskintersect
maskIntersect srca, srcb, dest
Set the destination mask to the intersection of the given source masks.
srca (a Mask)
srcb (a Mask)
dest (a Mask)
maskleft
maskLeft amask
Returns the coordinates of its left edge.
amask (a Mask)
Page 922
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a s k r i g h t
See Also
maskBoundsRect .
maskright
maskRight amask
Returns the coordinates of its right edge.
amask (a Mask)
See Also
maskBoundsRect .
masktop
maskTop amask
Returns the coordinates of its top edge.
amask (a Mask)
See Also
maskBoundsRect .
max
max Number, more-numbers
This function returns the argument that is greatest (closest to positive infinity). It is an
error if any of the arguments is not a non-complex number.
number (a Number)
[[moreNumbers]*] (a Number)
See Also
min
maybeWriteObjectName
maybeWriteObjectName obj, thestream
Page 923
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m a y b e W r i t e P r o j e c t Q u a l i fi c a t i o n
If the object is named, this function writes its objectName (qualified if necessary) and
returns True . Otherwise it simply returns False
See Also
objectName , writeObject
maybeWriteProjectQualification
maybeWriteProjectQualification sym, thestream
with object
with project
Given a symbol, this function writes the appropriate “(in project SuchNSuch)” string to
the given stream.
See Also
writeObject
memDisown
memDisown typed-macptr
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 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.
typedMacptr
Page 924
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m e m O w n
See Also
ForeignMemory
memOwn
memOwn typed-macptr
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 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.
typedForeignMem
See Also
ForeignMemory
messageToUser
messageToUser message
with beep
with oktext
with textfont
with textsize
with width
with height
with h
with v
with system
This function brings up a simple dialog which displays a textual message and has an OK
button. It takes a string as a required argument. This is the message which is displayed.
Note that the button will resize to accomodate the okText .
Page 925
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
m i n
Example
The following displays a dialog expressing the sheer joy of the application.
messageToUser "I am so happy that I can barely stand it!" with
okText "Goody"
min
min Number, more-numbers
This function returns the argument that is greatest (closest to positive infinity). It is an
error if any of the arguments is not a non-complex number.
number (a Number)
[[moreNumbers]*] (a Number)
See Also
max
modalDialog
modalDialog dialog
This function takes any Actor as its required object. The funtion then enters an event mode
and puts the actor on stage. The event mode prevents the user from clicking on any item
other than the actor. It is up to the actor to provide some mechanism (e.g. an OK button)
which calls exitModalState to exit the dialog.
Page 926
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
n a m e A l r e a d y I n U s e
Example
modalDialog of DopeyDialog
nameAlreadyInUse
nameAlreadyInUse thestring, theproj
Teturns True if the given string is the name of an existing object in the given project.
negative
negative num
This function returns True if its argument num is strictly less than zero, and False
otherwise. It is an error if the argument is not a non-complex number.
num (a Number)
Example
negative (-1)-- returns True
negative (2.5)-- returns False
negative (0)-- returns False
See Also
positive
newFileDialog
newFileDialog
with project
with directory
with title
with buttontext
This function brings up a new File Dialog. It returns a file object pointing to the potential
new file.
Page 927
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
n e w I n d i r e c t Te x t
[with directory]: This takes a Sk8 file object which specifies the default
directory.
[with project]: This specifies the project of the returned file.
[with macFileType]: This specifies the file type to filter by. Note this must be
a four letter string, e.g. "TEXT" , or False .
[with title]: This is the text used at the top of the dialog.
newIndirectText
newIndirectText baseText, fromState, toState
Creates a new indirect text object, initializing its properties to the given values.
newMemHandle
newMemHandle typesymorstring
Advanced users sometimes call code written in languages other than SK8 Script. Such
code is called "foreign" code. Sometimes foreign code manipulates data which must not
be moved and must be explicitly allocated and freed. In general it is tedious and error
prone to do this. However, if you must bit twiddle and feel that you really know what
you are doing, you can allocate and deallocate static memory explicitly. This function lets
you allocate memory as a native operating system memory Handle. Note that such
memory operations are unsafe. You can easily crash your machine if these memory
management functions are used as you are stepping outside of the safety of the SK8
system. See the SK8 User Guide's chapter "SK8 Foreign Function and Data Interface" for
information on declaring structured foreign memory "Types".
typeSymOrString
Example
set aGlerphHandle to newMemHandle( glerphType )
See Also
newMemPointer, disposeMem
Page 928
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
n e w M e m P o i n t e r
newMemPointer
newMemPointer typesymorstring
Advanced users sometimes call code written in languages other than SK8 Script. Such
code is called "foreign" code. Sometimes foreign code manipulates data which must not
be moved and must be explicitly allocated and freed. In general it is tedious and error
prone to do this. However, if you must bit twiddle and feel that you really know what
you are doing, you can allocate and deallocate static memory explicitly. This function lets
you allocate memory as a native operating system memory Pointer. Note that such
memory operations are unsafe. You can easily crash your machine if these memory
management functions are used as you are stepping outside of the safety of the SK8
system. See the SK8 User Guide's chapter "SK8 Foreign Function and Data Interface" for
information on declaring structured foreign memory "Types".
typeSymOrString
Example
set aGlerphPointer to newMemPointer( glerphType )
See Also
newMemPointer, disposeMem
newprojectdialog
newProjectDialog
with project
with label2
This function brings up an new File Dialog with the ability to both name a project and
name the file the project is to appear in. If the user specifies a new project, it will be
created.
[with project]: This specifies the project which is to be the parent of the new
project.
[with directory]: This takes a Sk8 file object which specifies the default
directory.
[with title]: This is the text used at the top of the dialog.
[with label2]: This specifies the text above the second text field.
not
not Object
This function returns True if its argument is False , and True otherwise.
Page 929
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o b j e c t F r o m
object
See Also
untrue
objectFrom
objectFrom prop, obj
This function returns the object from which the specified object inherits the specified
property.
prop
obj
Example
objectFrom 'fillColor', Rectangle -- returns Actor.
objectFromObjectID
objectFromObjectID id
objectIDFromObject
objectIDFromObject theobject
objectnamedialog
objectNameDialog objlist
This function is used for displaying a dialog to change the objectname of a particular
object. It takes the object as the only required argument. The dialog allows the user to
specify a valid objectname or leave the field blank to make the object anonymous.
objectsinterestedinevent
objectsInterestedInEvent eventdispatcher, event
Page 930
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o b j e c t S t r i n g
Returns a list of all the objects that are interested in receiving the event when the
eventDispatcher gets it.
See Also
objectString
objectString obj
with project
This function handles printing the object's name to the current output stream. The ouput
is guaranteed to be readable as a Sk8Script object identifier.
obj: The object whose name you want to print onto the ouptut stream
[with project]
See Also
odd
odd int
This function returns True if its argument is odd (not divisible by 2), and otherwise
False . It is an error if the argument is not an integer.
Example
odd (2)-- returns False
odd (9)-- returns True
See Also
even
Page 931
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o k s k 8 c h a r a c t e r
oksk8character
okSK8Character thechar
Checks that the given charater is an alphanumeric character or one of these characters:
Delete, Space, Escape, DoubleQuote, UpArrow, downArrow, BackArrow, ForwardArrow,
return, enter, Newline, and tab.
oktogetvaluefromuser
okToGetValueFromUser obj, prop
obj
prop
openfiledialog
openFileDialog
with project
with directory
with macfiletype
with title
with buttontext
This function brings up an Open File Dialog. It returns a file object pointing to the selected
file.
[with directory]: This takes a Sk8 file object which specifies the default
directory.
[with project]: This specifies the project of the returned file.
[with macFileType]: This specifies the file type to filter by. Note this must be
a four letter string, e.g. "TEXT" , or False .
[with buttonText]: This specifies the text of the open button.
Example
openFileDialog with project foo with MacFileType "WOOD" with
buttontext "Load"
openprojectdialog
openProjectDialog
with newbutton
with directory
Page 932
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
o p e n p r o j e c t fi l e
This function brings up an Open File Dialog showing only potential project files. It opens
the project and returns the project object.
[with directory]: This takes a Sk8 file object which specifies the default
directory.
[with newbutton]: This specifies whether or not a button which give the
user the ability to create a new project is visible.
openprojectfile
openProjectFile filename
load a project from its store file
optionKeyDown
optionKeyDown
This function returns True if the Option key on the keyboard is currently held down, and
False otherwise.
See Also
originalPropertyValue
originalpropertyvalue me, propertyName, originalObject
Finds the “original” value of the given property of the object. That is, the value this
property would have been initialized to based on the parent (or original) object.
This mainly useful for determining, within an initialize handler, whether a given
property of the new object has been changed from its original value. Such a change may
have been made by a more specific initialize handler or by the automatic
maintanence of creationRelations .
See Also
initialize , creationRelations
Page 933
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p h a s e
phase
phase Number
This function returns the phase of its argument, i.e. the angle part of its polar
representation as a complex number. The phase of a positive non-complex number is zero;
that of a negative non-complex number is π; the phase of zero is zero. It is an error if the
argument is not a number.
number
position
position item
with in
with test
with exactmatch
Returns the position (a positive integer) of the item's first occurrence in the given
collection, or False if it does not occur at all.
Note: The behavior of position is entirely determined by the positionOfItem
handler. Thus, its behavior can be specialized for a given collection by defining a
positionOfItem handler on that collection.◆
item
in (a Collection)
[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
positionOfItem , contains
positive
positive num
This function returns True if its argument num is strictly greater than zero, and False
otherwise. It is an error if the argument is not a non-complex number.
num (a Number)
Page 934
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
p r e v i o u s E v e n t M o d e
Example
positive (1)-- returns True
positive (1-2.5)-- returns False
positive (0)-- returns False
See Also
negative
previousEventMode
previousEventMode
processUnusedInitializerArguments
processUnusedInitializerArguments object, initializerarguments
For all keyword arguments in initializerArguments that haven't been marked as used (by
initializerArgument ), this calls the appropriate setters with the corresponding
values.
Note: This is called automatically by new and copy after initialize has been called.
Thus, it should only be used within an initialize handler in cases where some of the
initialization can't take place until all the initializer arguments have been applied.◆
See Also
putScrap
putScrap thehandle, thetype
Adds the handle to the system scrap so that it is available to other applications.
Note: there is no need to call this function. It is a low level one which is used by the
SK8Clipboard object to talk to the scrap. Use the SK8Clipboard object instead.◆
Page 935
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
q u i t
See Also
quit
quit
with dialog
This function quits SK8, with or without a confirmation dialog (depending on the value of
the dialog argument).
raiseSystemError
raiseSystemError trapname, errresult
trapName
errNum
raiseUnsettablePropertyError
raiseUnsettablePropertyError property, theobject
Raises a GeneralProgrammingError informing the user that
property of theObject can't be modified.
random
random Number, state
number
realPart
realPart Number
Page 936
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e c t To M a s k
number (a Number)
See Also
rectToMask
rectToMask left, top, right, bottom, amask
Apply the coordinates of a rectangle to the given mask object.
See Also
maskBoundsRect .
removeConstantDialog
removeConstantDialog proj
with name
with textfont
with textsize
with width
with height
with h
with v
with cancel
This function has one required argument which specifies a project, and one keyword name
which specifies a symbol for a constant. It displays a dialog asking the user if they wish to
remove the constant from the project. If they do, the constant is removed.
Page 937
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e m o v e D u p l i c a t e s
removeDuplicates
removeDuplicates alist
The elements of the given list or vector are compared pair-wise and if any two match then
the one occurring earlier in the sequence is removed.
removeEventInterest
removeEventInterest interestedobject, event, eventdispatcher
This function removes the interestedObject from the set of objects that want to be
notified when the event is called on the eventDispatcher.
interestedObject (an Object): The object that wants to stop being notified of
the event.
event (a Symbol): The event the object was being notified about.
eventDispatcher (an Object): The object that originally received the event
and dispatched it to the interestedObject .
See Also
Page 938
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e m o v e F u n c t i o n D i a l o g
removeFunctionDialog
removeFunctionDialog me
with textfont
with textsize
with width
with height
with h
with v
with cancel
This function has one required argument which specifies a function object. It displays a
dialog asking the user if they wish to remove the function from its project. If they do, the
function is removed.
removeHandlerDialog
removeHandlerDialog thehandler
with textfont
with textsize
with width
with height
with h
with v
with cancel
This function has one required argument which specifies a handler object. It displays a
dialog asking the user if they wish to remove the handler from its object. If they do, the
handler is removed.
Page 939
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e m o v e P a r e n t D i a l o g
removeParentDialog
removeParentDialog objects, parent
with textfont
with textsize
with width
with height
with h
with v
with cancel
This function takes two required arguments. The first is an object or a list of objects. The
second is a parent shared by all of the objects. The function displays a dialog which asks if
the user wishes to remove this parent from the objects. If the user chooses yes, then the
parent is removed from each object.
Page 940
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e m o v e P r o p e r t y D i a l o g
removePropertyDialog
removePropertyDialog property, objects
with textfont
with textsize
with width
with height
with h
with v
with cancel
This function takes two required arguments. The first is a symbol specifying a property
name. The second is an object or a list of objects. The function displays a dialog which
asks if the user wishes to remove this property from the objects. If the user chooses yes,
then the property is removed from each object.
removeVariableDialog
removeVariableDialog proj
with name
with textfont
with textsize
with width
with height
with h
with v
with cancel
This function has one required argument which specifies a project, and one keyword name
which specifies a symbol for a variable. It displays a dialog asking the user if they wish to
remove the variable from the project. If they do, the variable is removed.
Page 941
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e n d e r A M e d i a E r r o r
renderAMediaError
renderAMediaError themedia, therenderer, theactor, region
This function is called when the system fails to obtain the data out of a media object.
Instead of crashing, an image that conveys the “bad state” is rendered instead. This is
done by calling the renderAnError function.
themedia (a Media): The media that could not be initialized for drawing.
therenderer (a Renderer): The renderer that uses the media.
theactor (an Actor): The actor that we were trying to render with the media.
region (a Mask): The region that was to be rendered.
See Also
renderAnError.
renderAnError
renderAnError therenderer, theactor, region
This function is called when the conditions required for rendering are not met. This is
usually determined in the body of a render handler. This function, which is guaranteed
not to produce an error itself, renders an image of an fallen Mac that has bled to death.
Not a pretty sight. Anytime you see this image, something has gone wrong in the
rendering of a color.
You can use this function when you define your own render handlers.
Page 942
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
r e r a i s e
See Also
render of Renderer.
reraise
reraise Condition
Condition
rest
rest list
reverse
reverse sequence
round
round Number, divisor
This function converts its input to an integer by rounding to the nearest integer; if the
input is exactly halfway between two integers, then it is rounded to the one that is even. If
a single argument is given, the input is that argument; if two are given, the input is the
first divided by the second. It is an error if either of the arguments is not a non-complex
number.
number (a Number)
[divisor] (a Number)
See Also
roundBoxDimensions
roundBoxDimensions box
Page 943
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e a r c h T h i n g
Returns its argument after rounding the elements in such a way that the width and height
of the result are rounded versions of the width and height of the argument box. The left
component is rounded and the remainder is added to the right component, which is
then rounded. Similarly for top and bottom .
searchThing
searchThing thingtosearchfor, wheretosearchforit
Given two sequences of object, the second object is searched for a sub-sequence that
matches the first sequence. If a match is found, searchThing will return the index into
the second sequence of the leftmost element of the leftmost matching sub-seque
selectedItemsBoundsRect
selectedItemsBoundsRect theactor
theactor
selectFromCollectionDialog
selectFromCollectionDialog candidatelist
with textfont
with textsize
with width
with height
with h
with v
with title
with alphabeticaldisplay
with multiplevalues
with cancelstring
with buttonstring
with system
This function takes a collection as an argument and displays a Macintosh dialog with a
scrolling list of the elements of the collection. There are two buttons: a “select” button and
a “cancel” button. If the the users makes a choice and selects okay, it returns the collection
item they selected.
Page 944
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e n d To L o g
sendToLog
sendToLog obj
with attention
This function sends the object specified to the current system log. This is the value of the
systemLog property of SK8 (the object). A call to this function usually results in the
object specified being printed providing some feedback to the user.
In order to be a suitable systenLog, the object in question has to implement the following
two handlers: insertInto which adds the object specified and shows it in some way,
and getAttention which should do something to make sure the user notes the message
that was sent.
Example
In SK8, the default systemLog is the MessageBox . When we want to print something in
it, we can type:
sendToLog "My message"
Which would print the string provided into the MessageBox. Using the optional argument
we can make the MessageBox come to the front as the message gets printed.
sendToLog "My message" with attention
Page 945
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s e t Va l u e
setValue
setValue property, obj, value
Set the propertiy's value (without calling the actual setter handler).
shiftKeyDown
shiftKeyDown
This function returns True if the Shift key on the keyboard is currently held down, and
False otherwise.
See Also
showMediaInActor
showMediaInActor imagerenderermedia, theactor
This function makes sure the actor displays the media in its fillColor. If its fillColor
is an ImageRenderer, it sets its media to the media provided and forces a redraw.
Otherwise it makes a new imageRenderer and sets the fillColor of the actor to it.
The new renderer is created in the actor's project .
sign
sign anumber
Given a positive number this function returns 1; given a negative number it returns -1;
and given zero it returns zero. It is an error if the argument is not a number.
number (a Number)
simpleObjectString
simpleObjectString obj
with project
Page 946
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s i n
This function handles printing the object's name to the current output stream. The ouput
is not guaranteed to be readable as a Sk8Script object identifier.
obj: the object whose name you want to print onto the ouptut stream
[with project]
See Also
sin
sin radians
This function returns the sine of its argument. The argument is in radians. It is an error if
the argument is not a number.
number
See Also
sin , cos , tan , asin , acos , atan , sinh , cosh , tanh , asinh , acosh , atanh
sinh
sinh radians
This function returns the hyperbolic sine of its argument. It is an error if the argument is
not a number.
number
See Also
sin , cos , tan , asin , acos , atan , sinh , cosh , tanh , asinh , acosh , atanh
sort
sort sequence, predicate
with key
spliceNewParent
spliceNewParent kids
with objectname
Page 947
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s q r t
This function takes a list of objects of a common type and creates a new parent for them all
to share. This is useful in dynamically restructuring the inheritance hierarchy.
kids (a list): A list of objects which are all in the same project and which have
the same set of parents.
with objectName: The objectName of the newly created parent.
Example
Let's say that you have made two different RoundRect buttons in a window. You realize
that there should be a prototype Button object that all buttons in your project would
share. Therefore, you can call SpliceNewParent of {HappyButton, SadButton}
with objectname "Button" in order to create a new RoundRect named "button". You
can then add handlers and properties (e.g. an 'enabled' property) to the "Button" object
and they will be inherited by the HappyButton and the SadButton.
sqrt
sqrt Number
This function returns the principal square root of its argument. If the argument is not
complex but is negative, then the result will be a complex number. It is an error if the
argument is not a number.
Note: This function is simply a shorthand for the function squareRoot .◆
number (a Number)
See Also
squareRoot
squareRoot
sqrt Number
This function returns the principal square root of its argument. If the argument is not
complex but is negative, then the result will be a complex number. It is an error if the
argument is not a number.
Note: The function sqrt is a shorthand for this function.◆
number (a Number)
See Also
sqrt
Page 948
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
s t a r t N e w M a s k
startNewMask
startNewMask thepen
Opens the mask's region so that the drawing commands that follow this function call will
define that region (see the OpenRgn toolbox call in Inside Mac). Recording proceeds until
finishNewMask is called.
thePen (a Pen): The pen that will be used to accumulate the mask as it is
being built. The Pen object can be used for this.
See Also
finishNewMask .
stopLoggingCalls
stopLoggingCalls handlerorname, Object, qualifier
handlerorname
object
qualifier: Obsolete! Should always be False !
string
string Object
Coerces thing to a String if possible. The given object must be a String , a Character,
or a Symbol .
thing
See Also
systemTickCount
systemtickcount
Returns the current tick count of your system. Note there are sixty ticks a second and this
is constantly updated.
tagDialog
tagDialog objlist
Page 949
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t a n
This function is used to bring up a dialog to tag one actor as a part of another actor. It
takes a single argument and it brings up a dialog asking the user to tag the specified object
as a part of its container. The user may enter any valid property name and the actor is
given that tag.
tan
Tan radians
This function returns the tangent of its argument. The argument is in radians. It is an error
if the argument is not a number.
number
See Also
sin , cos , tan , asin , acos , atan , sinh , cosh , tanh , asinh , acosh , atanh
tanh
tanh radians
This function returns the hyperbolic tangent of its argument. It is an error if the argument
is not a number.
number
See Also
sin , cos , tan , asin , acos , atan , sinh , cosh , tanh , asinh , acosh , atanh
tickEventClock
tickEventClock
This function ticks the SystemClock to ensure that all clocks continue running. If you
write a tight piece of code and find that your clocks do not get tick events while it runs,
you might have to call this function.
See Also
Page 950
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t i l e
tile
tile actorlist
with rows
with columns
with hspacing
with vspacing
with relativeactor
with boundsrect
with resizing
with physical
This function is used to tile a set of actors in a specified area. The actors are arranged into
a grid.
The area in which the objects are tiled is specified by either a relativeactor or by a
boundsRect (note that if you specify a boundsRect , you can also specify whether this
to be physical or not).
toMemHandle
toMemHandle a-macptr, type-sym-or-str, autodispose?
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 your machine. 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.
If autoDispose is False, you telling SK8 not to invoke the disposeMem handler on it. You
take complete responsibility for disposing the handle. IF AUTODISPOSE IS FALSE,
DISPOSEMEM WILL IGNORE THE HANDLE AND TAKE NO ACTION. You can call
memOwn at any time to give SK8 ownership of the memory.
Page 951
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
t o M e m P o i n t e r
foreignMem
typeSymOrString
autoDispose
See Also
ForeignMemory, toMemPointer
toMemPointer
toMemPointer a-macptr, type-sym-or-str, autodispose?
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 your machine. 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.
If autoDispose is False, you telling SK8 not to invoke the disposeMem handler on it. You
take complete responsibility for disposing the pointer. IF AUTODISPOSE IS FALSE,
DISPOSEMEM WILL IGNORE THE POINTER AND TAKE NO ACTION. You can call
memOwn at any time to give SK8 ownership of the memory.
foreignMem
typeSymOrString
autoDispose
See Also
ForeignMemory, toMemHandle
truncate
truncate Number, divisor
This function converts its input to an integer by truncating toward zero; that is, the result
is the integer of the same sign as the input and which has the greatest integral magnitude
not greater than that of the input. If a single argument is given, the input is that argument;
if two are given, the input is the first divided by the second. It is an error if either of the
arguments is not a non-complex number.
number (a Number)
[divisor] (a Number)
Page 952
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
T _ fi x e d T o N u m b e r
See Also
T_fixedToNumber
T_FixedToNumber fixed
Converts a Mac Toolbox Fixed type to a number.
fixed
T_fractToNumber
T_FractToNumber fract
Converts a Mac Toolbox Fract type to a number.
fract
T_numberToFixed
T_NumberToFixed num
Converts a Number to a Mac Toolbox Fixed type.
num
T_numberToFract
T_NumberToFract num
Converts a Number to a Mac Toolbox Fract type.
num
T_numberToShortFixed
T_NumberToShortFixed num
Converts a Number to a Mac Toolbox short Fixed type.
num
Page 953
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
T _ s h o r t F i x e d To N u m b e r
T_shortFixedToNumber
T_ShortFixedToNumber fixed
Converts a Mac Toolbox short Fixed type to a number.
fixed
undoableSet
undoableSet propertyName, objs, value
with confirmation
This function allows the user to set a property in such a way that it can later be undone.
The first argument specifies a symbol for a property name. The second specifies the object
or set of objects whose property is to be set. The third argument specifies the value that
this property is set to.
Once set, the system event setInform is passed to inform listeners that a property has
been altered. The function UndoLastSet can be used to undo the property setting.
See Also
undolastset
undolastset
This function is used to undo the last property setting done by UndoableSet . It takes no
arguments. It uses the UndoableSetLog to find out what the last property setting was,
and it resets the values of the set properties to their original values. In addition, it stores
the properties current values so the undo can be undone.
Once reset, the system event setInform is passed to inform listeners that a property has
been altered.
See Also
untrue
untrue thing
Page 954
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
u n W i r e P o r t s
This function returns True if its argument is False , and True otherwise.
object
Example
untrue (3=2)-- returns True
untrue (3=3)-- returns False
untrue (3)-- returns False
See Also
not
unWirePorts
unwirePorts me, toport
Wires/unwires the ports, warns the user if they're already wired, or if fromPort is a
broadcast port
updateTextDependentStates
updateTextDependentStates substart, subend, postshift,
dependentStates
subStart
subEnd
postShift
dependentStates
updateVectorDependentStates
updateVectorDependentStates substart, subend, postshift,
dependentStates
subStart
subEnd
postShift
dependentStates
uppercase
uppercase textorcharacter
Page 955
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
v e c t o r
Returns a copy of the given argument with all of its characters coerced to uppercase. It is
an error if the argument is not a descendant of Text or Character.
textOrCharacter
See Also
lowercase
vector
Vector objects
warnIfInSuperProject
warnIfInSuperProject handlerproject, handlerName, handlerobject,
handlerqualifier
Display a warning if the suggested new function/handler would clobber an existing
function/handler that is already defined in a super project. You are given a choice to
continue (and thus clobber the existing function/handler) or not.
with clippedMask
with clippedmask fcn, themask, thepaper
This “with handler” executes its body having clipped to the mask provided. This should
only be called in the body of render handlers.
themask (a Mask)
thePaper: The "thePaper" argument that is passed to the render handler
should be used for this argument.
See Also
the “with handler” section of the User Guide's SK8Script Language chapter
Page 956
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w i t h c u r s o r
with cursor
with cursor fcn, cursr
This “with handler” executes its body having set the cursor of the Stage to the cursor
provided.
cursr (a cursorRSRC)
See Also
the cursor of the Stage , with lockedCursor, the “with handler” section of the User
Guide's SK8Script Language chapter
with deferredAction
with deferredaction fcn
This “with handler” defers the execution of its body, queuing it up to be executed when
the event system finishes processing the current event.
with eventsDisabled
with eventsdisabled fcn
This “with handler” disables event handling (for keyboard and mouse events) during the
execution of its body. Any events occurring during its execution are queued up and
handled after its execution.
See Also
the “with handler” section of the User Guide's SK8Script Language chapter
with lockedActor
with lockedactor fcn, actr
with effect
with speed
This “with handler” executes its body with the actor locked. All graphical changes that are
made within the body are only shown at once at the end.
Page 957
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w i t h l o c k e d C u r s o r
See Also
the “with handler” section of the User Guide's SK8Script Language chapter
with lockedCursor
with lockedcursor fcn, cursr
This “with handler” executes its body with the cursor of the Stage set to the cursor
provided. This differs from with cursor in that this one prevents the cursor from being
changed during the body.
cursr (a CursorRSRC): The cursor to set the cursor of the Stage to.
See Also
the cursor of the Stage , with cursor, the “with handler” section of the User Guide's
SK8Script Language chapter
with lockedScroller
with lockedscroller fcn, thescroller
This “with handler” executes its body with the scroller locked. Only when the body ends
is the scroller redrawn. This is used by setScrollerVals to set all the scroller's
properties without forcing a redraw each time a property changes value.
theScroller (a Scroller): The scroller to be locked for the body of this function.
See Also
setScrollerVals of Scroller.
with macResourceFile
with macresourcefile fcn, theFile
This "with handler" executes its body with the current resource file set to the file provided.
If this file object denotes an existing file, the file is opened and made the current resource
file for use. If the file does not exist, a file is created before the body executes.
Page 958
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w i t h p e n
Example
This example shows a function that allows you to remove an arbitrary resource from an
arbitrary file. Here is the code:
on removeResource theFile, theType, theId
with macResourceFile theFile
set theHandle to T_get1Resource(theType, theId)
T_RemoveResource theHandle
end with
end removeResource
with pen
with pen fcn, thepen, thepaper
This “with handler” executes its body with the pen installed as the current Pen for all
graphics. Calls install and deinstall to set the pen.
thePen (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
install and deinstall of Pen , the “with handler” section of the User Guide's
SK8Script Language chapter.
with project
with project fcn, proj
This “with handler” specifies an alternate target project for the creation of new objects
during the execution of its body. Any calls to new or copy within the body (or within calls
made in the body) that don't specify a target project will use the given project as their
target project.
See Also
new, copy, the “with handler” section of the User Guide's SK8Script Language chapter.
with targetObject
with targetobject fcn, targetobject
Page 959
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
w i t h v i s u a l E f f e c t
This “with handler” specifies a target object for the definition of handlers within the local
(lexical) context of its body. Any handler definition within the body that doesn't specify
the object on which to define the handler will define it on the given object.
Example
with targetObject rectangle 3 in the Stage
on mousedown of me
set my fillColor to Red
end mousedown
end with
See Also
the “with handler” section of the User Guide's SK8Script Language chapter
with visualEffect
with visualeffect fcn, theeffect
with on
with speed
This “with handler” executes its body with the actor specified in the on argument locked.
When the actor is unlocked at the end, it is done with the visual effect specified.
See Also
the “with handler” section of the User Guide's SK8Script Language chapter
writeUninterestingObject
writeUninterestingObject me, thestream
This function writes the object's description; e.g. "item 1 in the Stage" or
"ConsoleMenu (in Project UI)" , etc.
Page 960
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
y e s O r N o D i a l o g
See Also
writeObject
yesOrNoDialog
yesOrNoDialog message
with textfont
with textsize
with width
with height
with h
with v
with cancel
with yestext
with notext
with system
This function brings up a dialog for getting a yes or no answer from the user. It takes a
single argument which is the string displayed in the dialog. There are three buttons in the
dialog: “Yes”, “No” and “Cancel”.
zeroscrap
zeroScrap
Clears the system scrap file.
See Also
Page 961
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
z o o m b o u n d s r e c t
zoomboundsrect
zoomBoundsrect
with from
with to
with numberofframes
with duration
Generates a Macintosh Finder-style zooming rectangle special effect (i.e. the expanding
grayish rectangles which zoom out from the opened icons).
zoomrect
zoomRect fromleft, fromtop, fromright, frombottom, toleft, totop,
toright, tobottom
with numberofframes
with duration
Page 962
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
C h a r
Constants
Char
This constant is bound to the object Character and simply provides a shorthand for
referring to that object.
See Also
Character
Delete
This constant is bound to the character corresponding to the Delete key on the keyboard.
Its ASCII code is 8.
See Also
Character, ascii
DownArrow
This constant is bound to the character corresponding to the down-arrow key on the
keyboard. Its ASCII code is 31.
See Also
Character, ascii
Enter
This constant is bound to the character corresponding to the Enter key on the keyboard.
Its ASCII code is 3.
See Also
Character, ascii
Page 963
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
E n t e r
Page 964
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
E s c a p e
Escape
This constant is bound to the character corresponding to the Escape key on the keyboard.
Its ASCII code is 27.
See Also
Character, ascii
LeftArrow
This constant is bound to the character corresponding to the left-arrow key on the
keyboard. Its ASCII code is 28.
See Also
Character, ascii
Mac68KMPWCLoadSpec
Load specifications tell the foreign code loader how to interpret the bits in the load
module specified in the loadForeign command. This load specifier is for load files which
conform to Macintosh motorola 680x0 MPW C load module standards.
Example
loadForeign( Mac68KMPWCLoadSpec, "myCTestLib.o" )
See Also
loadForeign , Mac68KPascalLoadSpec
Mac68KPascalLoadSpec
Load specifications tell the foreign code loader how to interpret the bits in the load
module specified in the loadForeign command. This load specifier is for load files which
conform to Macintosh motorola 680x0 Pascal load module standards.
Example
loadForeign( Mac68KPascalLoadSpec, "myPascalTestLib" )
See Also
loadForeign , Mac68KMPWCLoadSpec
Page 965
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
N e w l i n e
Newline
This constant is bound to the character corresponding to the Return key on the keyboard.
Its ASCII code is 13.
See Also
Character, ascii
Para
This constant is bound to the object Paragraph and simply provides a shorthand for
referring to that object.
See Also
Paragraph
Pi
This constant is bound to 3.141592653589793, the best possible approximation to π in
BigFloat format.
See Also
BigFloat
Quote
This constant is bound to the double-quote (") character. Its ASCII code is 34.
See Also
Character, ascii
RightArrow
This constant is bound to the character corresponding to the right-arrow key on the
keyboard. Its ASCII code is 29.
See Also
Character, ascii
Page 966
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
S p a c e
Space
This constant is bound to the character corresponding to the space bar on the keyboard.
Its ASCII code is 32.
See Also
Character, ascii
Tab
This constant is bound to the character corresponding to the Tab key on the keyboard. Its
ASCII code is 9.
See Also
Character, ascii
UpArrow
This constant is bound to the character corresponding to the up-arrow key on the
keyboard. Its ASCII code is 30.
See Also
Character, ascii
Page 967
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
U p A r r o w
Page 968
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
C a n c e l K e y A c t i o n
Global Variables
CancelKeyAction
This variable controls the "cancel key" (Command-.). If it is set to False , Command-. is
treated as a normal commandKeyEvent . Otherwise CancelKeyAction should be set to
the name of a function to be called with no arguments when Command-. is pressed.
Note: The default value of CancelKeyAction is 'abortBreak' .◆
See Also
commandKeyEvent , abortBreak
EventsStopForMenus
This variable determines whether the event system stays active when a menu is pulled
down. The default is False , allowing movies, clocks and animations to be played as
menus are pulled down. By setting this variable to True , the standard Macintosh
behaviour is obtained: movies do not play while a menu is pulled down.
Note: when a menu intersects a playing movie or an animation, the movie will draw itself
on top of the menu causing a slightly unpleasant effect. As an author you should be aware
of this problem and the two ways to deal with it: you can make sure movies and
animations cannot intersect any menus or you can turn off this capability entirely.◆
InteractiveErrors
This variable controls whether or not ChooseResponse (a child of
ConditionResponse ) is invokable . If it is set to a non-False value (the default value
is False ) then a dialog from which one of the invokable responses can be chosen will be
brought up each time an error is raised.
Note: In the conditionResponses of SK8 , as shipped, ChooseResponse is the first
response for all errors. The actual behavior may differ from the above description if you
have modified SK8's conditionResponses table.◆
See Also
Page 969
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
L o c k e d S c r o l l e r
LockedScroller
This variable holds the Scroller that is currently in the process of scrolling. It is used by
with lockedScroller to avoid redrawing the scroller multiple times.
See Also
with lockedScroller.
ProcessingEvents
This variable indicates whether normal event processing is active. Most of the time its
value is True , but while an error or other condition is being handled its value is False .
Result
This variable is set to the result of the last SK8Script command or expression.
ScriptEditorPrototype
This variable determines the prototype version of the ScriptEditorWindow to use by
default when calling editHandler.
See Also
UISelection
This variable is set to the items currently selected by the selection halo. This is specific to
the Project Builder.
WriteObjectRecursionLimit
When writeObject is writing a recursive collection (a collection that contains itself,
directly or deeply) or a circular list (a list whose final ListPair is linked to its initial
ListPair ), this global determines the limit on the number of recursions allowed before
the recursion is terminated and the “[...]” notation is written. Its default value is 2.
Example
Assuming WriteObjectRecursionLimit is set to 2, this example creates a recursive
list and shows how it is written out.
Page 970
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
set x to {1, 2, 3}
insert x at the end of x
get x-- x is written as {1, 2, 3, {1, 2, 3, {[...]}}}
Page 971
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
Page 972
Draft. Confidential. ©1995 Apple Computer, Inc. 5/8/95
ð
Page 973
ð
Page 974
ð
Page 975
ð
Page 976
ð
Page 977
ð
Page 978
ð
Page 979
ð
Page 980
ð
Page 981
ð
Page 982
ð
Page 983
ð
Page 984
ð
Page 985
ð
Page 986
ð
Page 987
ð
Page 988
ð
Page 989
ð
Page 990
ð
Page 991
ð
Page 992
ð
Page 993
ð
Page 994
ð
Page 995
ð
Page 996
ð
Page 997
ð
Page 998