🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.micro.mac
Article #6082

Re: A Rascal/Quickdraw/user problem...

#6082
From: Paul DuBois
Date: Mon, 16 Jun 1986 16:03
36 lines
2261 bytes
> In my  random  attempts  to  learn  Rascal  and  do  some  useful 
> prototyping on the  Mac,  I'm  attempting,  as  part  of  a  user 
> interface simulation, to allow the creation of a "map" made up of 
> various icons, with those icons interconnected by lines.  So far, 
> no problem.
> 
> But, I want  the  user  to  be able to "drag" the icons around to 
> manually re-position them, so  I  attempted  to experiment with a 
> simple oval region and get  use  DragGreyRgn  to  do  the pulling 
> around (of the outline)  for  me.    For  this  test,  I  use the 
> following  two  code fragments to  generate  (and  remember)  the 
> placement of the region, and (in the second segment) to handle the 
> mousedown event  to  invoke  DragGreyRgn  and  pull  the  outline 
> around.  However, as indicated, I can't even get PtInRgn to agree 
> that I did a mousedown IN the oval region!  Hummm.

[code follows, containg...]

>                 in := PtInRgn(temppoint, RegionHandle);

In Rascal, all structures (including points) are passed by address.
Lisa Pascal passes all structures by address, unless they are four
bytes or less, in which case it passes them by value.  So for all
ToolBox expecting non-VAR points, you need to pass the .vh of the point,
e.g.,
		
                 in := PtInRgn(temppoint.vh, RegionHandle);


PS. DragGrayRgn, not DragGreyRgn.
-- 
Paul DuBois     UUCP: {allegra,ihnp4,seismo}!uwvax!uwmacc!dubois    |
                ARPA: dubois@easter                               --+--
                                                                    |
Doth the hawk fly by thy wisdom, and stretch her wings              |
toward the south?                        Job 39:26
Technical Details
Message-ID: <2260@uwmacc.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!princeton!caip!topaz!uwvax!uwmacc!dubois
References: <3594@decwrl.DEC.COM>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!princeton!caip!topaz!uwvax!uwmacc!dubois
From: dubois@uwmacc.UUCP (Paul DuBois)
Newsgroups: net.micro.mac
Subject: Re: A Rascal/Quickdraw/user problem...
Message-ID: <2260@uwmacc.UUCP>
Date: Mon, 16-Jun-86 12:03:21 EDT
Article-I.D.: uwmacc.2260
Posted: Mon Jun 16 12:03:21 1986
Date-Received: Wed, 18-Jun-86 03:05:35 EDT
References: <3594@decwrl.DEC.COM>
Organization: UW-Madison Primate Center
Lines: 36