There is a chapter in the collaborative book you may find useful http://book.pharo-project.org/ Hilaire Le 14/12/2011 02:19, Igor Stasenko a écrit :
I think best way is to create own Morph subclass and define #drawOn: method, where you can draw anything you want. Then you can embed it into a system window by using #addMorph: , or just use #openInWorld.
On 13 December 2011 20:29, Sean P. DeNigris <sean@clipperadams.com> wrote:
From KasperOsterbye:
This post has NOT been accepted by the mailing list yet. 15 years ago I did a lot in Smalltalk, and have done some recreational meta programming along the way. However, I now wanted to do something where I was in need of drawing a diagram with x and y axes on what I presume might be called a Canvas.
I lack a simple tutorial to get me started. I have looked at many, but they seem to presume I want to draw on the world "openInWorld". I should like not to scatter my world with line fragments and points, but keep it inside a "normal" window with borders, a background color (i.e. not a see through window). I have gone dead in two approaches.
First attempt is to use a SystemWindow, and then draw on the canvas I presume is there somewhere. I have just not been able to figure out how to find the canvas of that SystemWindow, nor what method presumeable does the painting.
Second attempt is to use a SystemWindow, and then add (addMorph:) line and circle morphs for my diagram. But it seems something is missing in my understanding there as well.
While it is fun that I can open circles and other stuff in "world", it is not what I need.
Small hits or direct solutions more than welcome.
-- Kasper
-- View this message in context: http://forum.world.st/Old-smalltalker-is-slightly-lost-tp4191432p4191432.htm... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
-- Dr. Geo -- http://www.drgeo.eu