<div dir="ltr"><div dir="ltr">Hi Karl!<br>Thanks! =)<br>I've added your last snippets to this:<br><br>  <a href="http://anggtwu.net/SQUEAK/Category-Edrx.st.html">http://anggtwu.net/SQUEAK/Category-Edrx.st.html</a><br>  <a href="http://anggtwu.net/SQUEAK/Category-Edrx.st">http://anggtwu.net/SQUEAK/Category-Edrx.st</a><br><br>As the urls to posts in the mailing list are very very long I'm<br>crediting you as the author of some snippets and classes by just<br>putting sentences like this one in the comments:<br><br>  Based on code that Karl Ramberg posted in 2023mar16.<br><br>If anyone wants to try, the instructions are: 1) fileIn the .st file<br>above, 2) treat the one-liners below as hyperlinks to places with more<br>code and/or more instructions, and Do The Right Thing:<br><br>  See edrxGuide: #drawOnAForm.<br>  See cm: (TestBezier >> #initialize).<br>  See cm: (TestDrawing >> #initialize).<br><br>Karl, your last snippets draw directly on the screen, and I just<br>realized that I should divide my doubts and questions in two parts: 1)<br>"how do I draw (on the screen)?" and 2) "how do I create a canvas that<br>behaves as a window or as a subwindow - i.e., that is surrounded by<br>thingies like TopLeftGrip, ..., BottomRightGrip, that implement<br>support for resizing and moving - and how do I draw inside that?"<br><br>Do you know anything about (2)?<br>  Cheers =),<br>    Eduardo Ochs<br>    <a href="http://anggtwu.net/eev-squeak.html">http://anggtwu.net/eev-squeak.html</a><br></div><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 16 Mar 2023 at 16:52, karl ramberg <<a href="mailto:karlramberg@gmail.com">karlramberg@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi,</div><div>See two partly finished morphs in attachment that draw on canvas using different routines</div><div><br></div><div>You can also draw to a form in a hackish way to make some generative art, see example below.<br></div><div>Morphic is quite forgiving and will mostly work even if you break the rules slightly :-)<br></div><div><br></div><div>brush := (Form extent: 1@1 depth: 32) fillBlack.<br> form := (Form extent:500@500 depth:32) fillWhite.<br>     y := form extent y -60.<br>       x := form extent x -60.<br>       segments := 8 atRandom +3.<br>    points := OrderedCollection new.<br>      1 to: segments do:[:r| <br>       points add: (x atRandom @ (y atRandom))+30].<br>  points add: (points first copy).<br>      0 to: 1 by: 0.01 do:[:j|<br>      1 to: segments do:[:i|<br>        form drawLine: brush<br>                                                  from: (points at:i) to: (points at:i+1)<br>                                                       clippingBox: form boundingBox<br>                                                 rule: Form paint fillColor: nil].<br>     d := OrderedCollection new.<br>   1 to: segments do:[:a|<br>                                  d add: (points at: a) +(j * ((points at: a+1)-(points at: a)))].<br>   d add: (d first copy).<br>        <br>      p := OrderedCollection new.<br>   1 to: segments do:[:aa|<br>                                                       <br>                                      p add: (d at: aa) +(j * ((d at: aa+1)-(d at: aa)))].<br>  <br>      p add: (p first copy).<br>        1 to:segments do:[:b|           <br>                                      form drawLine: brush<br>                                                  from: (p at:b) to:  (p at:b+1)<br>                                                       clippingBox: form boundingBox<br>                                                 rule: Form paint fillColor: nil].       <br>      <br>      form displayAt:10@60.<br> (Delay forMilliseconds: 10) wait.<br>     ].</div><div><br></div><div>Best,</div><div>Karl<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 15, 2023 at 11:28 PM Eduardo Ochs <<a href="mailto:eduardoochs@gmail.com" target="_blank">eduardoochs@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi list,<br>(or: hi Karl, but I decided to include other people too),<br><br>Karl, can you try this when you have some spare time, and tell me if<br>this approach makes sense? "This" is this:<br><br>  <a href="http://anggtwu.net/SQUEAK/Category-Edrx.st.html" target="_blank">http://anggtwu.net/SQUEAK/Category-Edrx.st.html</a><br>  <a href="http://anggtwu.net/SQUEAK/Category-Edrx.st" target="_blank">http://anggtwu.net/SQUEAK/Category-Edrx.st</a><br><br>After fileIn-ing that you will get a "Category-Edrx" with seven<br>classes. The simplest way to explore them is by doing:<br><br>  See see.<br><br>I renamed the TestMorph class that you sent in this e-mail<br><br><a href="http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223535.html" target="_blank">http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223535.html</a><br><br>to TestCanvas, and if you run this<br><br>  See edrxGuide: #testCanvas.<br><br>you will see some - still very bare and messy - notes on how to debug<br>this TestCanvas in a few different ways... I believe that it should be<br>possible to draw other things in that TestCanvas in the help topic<br>window using "tc" and "tc canvas", but I didn't have time to prepare<br>the examples yet...<br><br>  Cheers,<br>    Eduardo Ochs<br>    <a href="http://anggtwu.net/eev-squeak.html" target="_blank">http://anggtwu.net/eev-squeak.html</a><br><div><br></div></div>
</blockquote></div>
</blockquote></div></div>