[Squeakland] draw lines, event handling problem

Randy Heiland heiland at indiana.edu
Thu Jul 21 05:46:24 PDT 2005


Awesome.  Thanks so much Bert!  No, I wasn't aware of being able to directly
drag/drop a script tile into another script, but in hindsight all I can say
is - DUH.  Now I simply wonder when I would ever want to use the <obj> do
<script> tile.  I've still got much to learn about Squeak...

Thanks again, Randy

> -----Original Message-----
> From: Bert Freudenberg [mailto:bert at impara.de]
> Sent: Thursday, July 21, 2005 4:42 AM
> To: Randy Heiland
> Cc: 'squeak list'
> Subject: Re: [Squeakland] draw lines, event handling problem
> 
> 
> Am 20.07.2005 um 17:17 schrieb Randy Heiland:
> 
> > Hi Squeakers (and Tweakers),
> >
> > I'm hoping someone can help me understand/solve the problem I have
> > with a
> > fairly simple project.  Rather than fill mailboxes, I've put it
> > here (under
> > Lines segs - Event handling):
> >
> > http://poincare.uits.iupui.edu/~heiland/squeak/
> >
> > The project simply tries to draw line segments between 2 points and
> > I'm
> > guessing the problem has to do with the way events are handled in
> > Etoys,
> > although it could be something else entirely.
> 
> Actually, this is caused by your usage of the "do script" tile
> instead of using the line's "dist" script directly.
> 
> In this script:
> 
>      pt drawto
>          pt turn toward e
>          line do dist
>          pt forward by line's d
> 
> the line's "dist" script will only be executed *after* the "drawto"
> script finished. Also, it might not be called *immediately* after
> "drawto", but other scripts might get run in the mean time, too.
> However, it is executed before the next "tick". If you replace the
> "line do dist" tile by dropping the "line dist" tile directly in
> there, it will execute before the "pt forward by line's d" tile.
> 
>      pt drawto
>          pt turn toward e
>          line dist
>          pt forward by line's d
> 
> Are you even aware of the possibility to use a script dragged
> directly from the viewer as a "statement" tile in another script? If
> not, then we do have a serious user interface problem - the script
> tiles in the viewer surely look different from the "pre-made" tiles.
> But in fact, when making a new script this not any different from the
> premade ones ...
> 
> - Bert -




More information about the Squeakland mailing list