Great! Thanks. It works perfectly in Pharo 3 but not in Pharo 4. I thought that the drawOn: aCanvas was mandatory. I'm so lost in morphic. Trying to understand the logic of it slowly. Unfortunately there seems to be little documentation and a lot of what is there does not work in Pharo 3 or 4. Thanks again for taking the time! Best Nacho *Lic. Ignacio Sniechowski, MBA* *Prosavic SRL* *Tel: (011) 4542-6714* On Wed, Feb 4, 2015 at 5:30 PM, Sean P. DeNigris [via Smalltalk] < ml-node+s1294792n4803743h26@n4.nabble.com> wrote:
HilaireFernandes wrote First you don't need to subclass EllipseMorph... 100 to: 50 by: -1 do: [ :x | aBall height: x; bottom: 200 - x. World doOneCycle]
Of course you can have the best of both worlds by using Morphic stepping in your subclass, like:
EllipseMorph subclass: #Ball ... Ball>>#step self bottom: 200 - self nextHeight; height: self nextHeight.
self bottom = 100 ifTrue: [ increment := -1 ]. self bottom = 150 ifTrue: [ increment := 1 ].
For full code: Gofer it smalltalkhubUser: 'SeanDeNigris' project: 'SeansPlayground'; package: 'Ball'; load. Cheers, Sean
------------------------------ If you reply to this email, your message will be added to the discussion below:
http://forum.world.st/Question-on-Morphic-drawOn-method-tp4803695p4803743.ht... To unsubscribe from Question on Morphic drawOn: method., click here <http://forum.world.st/template/NamlServlet.jtp?macro=unsubscribe_by_code&nod...> . NAML <http://forum.world.st/template/NamlServlet.jtp?macro=macro_viewer&id=instant...>
----- Nacho Smalltalker apprentice. Buenos Aires, Argentina. -- View this message in context: http://forum.world.st/Question-on-Morphic-drawOn-method-tp4803695p4803749.ht... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.