[comp.sys.mac.hypercard] get object<s> at loc x,y

rieman@tigger.colorado.edu (John Rieman) (06/21/89)

Is there any way in hypertalk to get the types and id's of objects
covering a specific location?  For example, I'd like to write

   put objects at 200,300 into msg

and have

   card field id 30, card button id 42

appear.

I can loop through all the objects in the card, get their rect's,
and check to see if the point of interest is within each rect.  Is
their a more efficient way that I've missed?

-john

John Rieman
U. of Colorado
Boulder, Colorado
rieman@boulder.colorado.edu

dlugose@ecsvax.UUCP (Dan Dlugose) (06/21/89)

In article <9568@boulder.Colorado.EDU> rieman@tigger.colorado.edu (John Rieman) writes:
>Is there any way in hypertalk to get the types and id's of objects
>covering a specific location?  For example, I'd like to write
>
>   put objects at 200,300 into msg

   I would speed it up by an opencard handler that puts the list of
objects and their rects into a hidden field, so that a function call
like putObjects 200 300  would quickly return the requested info.
   It would be more complicated to keep track of newly created or
moving objects, but still not all that difficult.
   So far I've been disappointed that more HC programmers haven't
taken advantage of features of HC available though use of animation,
message passing, dynamic attribute setting, object oriented features,
and dynamic script modification.  Your question reminded me of several
ideas I haven't done much with yet, like buttons that move, communicate
with other objects, interact with their local environment, and use
functions and lookup tables to make decisions.
   Also, since a subset of Logo has been implemented in Hypertalk,
let's have more interactive control of objects in stacks!

   Dan Dlugose
   UNC Edu. Computing Service