[Newbies] How to draw a single pixel with permanence?

Bert Freudenberg bert at freudenbergs.de
Thu Apr 29 13:14:21 UTC 2010


On 29.04.2010, at 14:44, Lawson English wrote:
> 
> Bert Freudenberg wrote:
>> On 29.04.2010, at 13:15, Lawson English wrote:
>>  
>>> I'm trying to go back to beginnings with my own ManelBrot morph because I can quite grok how the one I have works.
>>> 
>>> Mostly because I still dont grok morphs.
>>> 
>>> Example: I'm trying to plot points on a morph using the drawOn message below:
>>>    
>> 
>> Paint into a Form. Draw the form in #drawOn:.
>> 
>> 
>>  
> 
> I'm sorry, I don't understand.
> 
> Isn't this "painting" into a Form?
> 
> aCanvas  form  colorAt: 30 at 30 put: Color black.

No, that's painting directly onto the Display (a.k.a. the canvas's form), which is considered bad style in Morphic. 

> My problem is that the pixel doesn't stay set.

30 at 30 would be in the upper-left corner of the Display. Unless your morph covers that, you won't see it.

You might try "self topLeft + (30 at 30)" but again, that's bad style.

In any case, I thought your question was about displaying the Mandelbrot set. It would be wise to paint that into a form, preferably in a background process. Then just update the display (by drawing the form) once a second until it's finished.

- Bert -




More information about the Beginners mailing list