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. Thanks for your help, Jeff _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
On Mon, Feb 11, 2013 at 10:24 AM, Jeff Gonis <[hidden email]> 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 _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
In reply to this post by Jeff Gonis-2
Look in Morph>>fullDrawOn:
and how it calls >>drawErrorOn: Doing [ self setProperty: #errorOnDraw toValue: false ] should resume your regularly scheduled program. Jeff Gonis 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. Thanks for your help, Jeff _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
On Tue, Feb 12, 2013 at 1:51 PM, Ben Coman <[hidden email]> wrote:
This would be a nice addition for the debug menu of a draw error morph.
Karl
_______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
Or it could be put into a 'Notes on Morphic development' page in the
help system. To do this get a most recent trunk image from http://www.squeakci.org/job/SqueakTrunk/ do the fix and submit it to the inbox. --Hannes On 2/12/13, karl ramberg <[hidden email]> wrote: > On Tue, Feb 12, 2013 at 1:51 PM, Ben Coman <[hidden email]> wrote: > >> ** >> Look in Morph>>fullDrawOn: >> and how it calls >>drawErrorOn: >> >> Doing [ self setProperty: #errorOnDraw toValue: false ] >> should resume your regularly scheduled program. >> > > This would be a nice addition for the debug menu of a draw error morph. > > Karl > >> >> Jeff Gonis 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. >> >> Thanks for your help, >> Jeff >> >> >> >> ------------------------------ >> >> _______________________________________________ >> Beginners mailing >> [hidden email]://lists.squeakfoundation.org/mailman/listinfo/beginners >> >> >> >> _______________________________________________ >> Beginners mailing list >> [hidden email] >> http://lists.squeakfoundation.org/mailman/listinfo/beginners >> >> > Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
Free forum by Nabble | Edit this page |