[Newbies] Reset Morphic Drawing After Error
Yoshiki Ohshima
Yoshiki.Ohshima at acm.org
Tue Feb 12 04:02:40 UTC 2013
On Mon, Feb 11, 2013 at 10:24 AM, Jeff Gonis <jeff.gonis at gmail.com> wrote:
> Hi Everyone,
>
> So when I am using Morphs in Squeak I like to instantiate a morph and then
> iteratively change it on the fly, having it respond to step calls, change
> how drawing works etc. All in all, this works pretty well and is one of my
> favorite ways to develop. However, one thing that does occur from time to
> time is that I will introduce an error that is triggered during the drawOn:
> call to the Morph. When this happens the morph stays instantiated in the
> world, but its canvas is drawn all red with a yellow "X" through it,
> indicating that my drawing code has failed.
>
> My question is how do I cause the drawing of the morph to be reset after I
> have corrected this error in the drawing code? As it stands now I just take
> the lazy way out and re-create the morph as a new object and continue on
> with my experimentation. However, if I could reset whatever drawing state
> needs to be reset, and have the morph continue on with the fixed code, this
> would be pretty great, and get me one step closer to my ideal method of
> development.
You get the halo for the Morph and choose the debug menu (the button
with a wrench icon on the right side). For a Morph that raised an
error during the drawing will have an extra menu item labeled: 'start
drawing again'. Choosing this does what you'd expect!
(As you can see, it just sends #resumeAfterDrawError to it. You can
do it from the workspace as well.)
--
-- Yoshiki
More information about the Beginners
mailing list