<div dir="ltr"><div><div>I have already implemented the canvas on which we draw, the possibility of drawing with the brush but with only a single color and a single size, a capacity to erase what we have already drawn with the &quot;Clear&quot; command on the custom menu code. <br>So, i&#39;d like to add the possibility of changing the color and the size of the brush presenting the choices of color and brush size.<br><br></div>The differents methods are:<br><br></div><div>&quot;Methods&quot;<br></div><div>extent: aPoint<br>    | newForm |<br>    super extent: aPoint.<br>    newForm := Form extent: self extent depth: 16.<br>    newForm fillColor: Color veryLightGray.<br>    form ifNotNil: [form displayOn: newForm].<br>    form := newForm.<br>     <br>     <br>initialize<br>    super initialize.<br>    self extent: 500@350.<br>     <br>drawOn: aCanvas<br>    aCanvas image: form at: bounds origin.<br>     <br>handlesMouseDown: evt<br>    ^ true     <br>     <br>mouseDown: evt<br>    brush := Pen newOnForm: form.<br>    brush roundNib: 3.<br>    brush color: Color red.<br>    lastMouse := evt cursorPoint - bounds origin.<br>    brush drawFrom: lastMouse to: lastMouse.<br>    self invalidRect:<br>    ((lastMouse - brush sourceForm extent corner:<br>    lastMouse + brush sourceForm extent)<br>    translateBy: bounds origin).<br>     <br>     <br>mouseMove: evt<br>    | p |<br>    p := evt cursorPoint - bounds origin.<br>    p = lastMouse ifTrue: [^ self].<br>     brush drawFrom: lastMouse to: p.<br>    self invalidRect: ((<br>        ((lastMouse min: p) - brush sourceForm extent) corner:<br>        ((lastMouse max: p) + brush sourceForm extent))<br>            translateBy: bounds origin).<br>    lastMouse := p.<br>     <br>     <br>addCustomMenuItems: aCustomMenu hand: aHandMorph<br>    super addCustomMenuItems: aCustomMenu hand: aHandMorph.<br>    aCustomMenu add: &#39;clear&#39; action: #clear.<br>     <br>     <br>clear<br>    form fillColor: Color veryLightGray.<br>    self changed.<br><br></div>&quot;Class PaintMorph&quot;<br><div>Morph subclass: #PaintMorph<br>    instanceVariableNames: &#39;form brush lastMouse&#39;<br>    classVariableNames: &#39;&#39;<br>    poolDictionaries: &#39;&#39;<br>    category: &#39;Morphic-Fun&#39;<br><br></div><div>&quot;Workspace&quot;<br>PaintMorph new openInWorld.<br><br><div><br></div><div>Thank you in advance.<br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-08-20 18:47 GMT+02:00 Bert Freudenberg <span dir="ltr">&lt;<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Sure. Just ask some specific questions - e.g. what you tried, what worked, what didn&#39;t etc.<div><br></div><div>- Bert -<br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Sat, Aug 20, 2016 at 10:59 AM, roger mpouma <span dir="ltr">&lt;<a href="mailto:rmpouma@gmail.com" target="_blank">rmpouma@gmail.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">Hello, <br>I need help for a drawing project on Squeak. I&#39;d like implement a canvas on which we draw with the possibility of drawing with brush changing the color and size of the brush. Is it possibile to have help ?<br><br>Thank you in advance. 
<br></div></div>______________________________<wbr>_________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@lists.squeakfoundation.org" target="_blank">Beginners@lists.squeakfoundati<wbr>on.org</a><br>
<a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://lists.squeakfoundation.<wbr>org/mailman/listinfo/beginners</a><br>
<br></blockquote></div><br></div></div></div>
<br>______________________________<wbr>_________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.<wbr>squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://lists.squeakfoundation.<wbr>org/mailman/listinfo/beginners</a><br>
<br></blockquote></div><br></div>