[Newbies] Re: Help with pen stuff

OrgmiGeek cool.origami.1 at gmail.com
Tue Jun 5 13:24:19 UTC 2012

>> In my spare time I decided to rite a simple paint program! I have
>> some problems: 
>> #1 does paint stuff work in the BorderedMorph category? 

>With a Pen you paint on a Form (which is an picture object holding pixels).
To display a Form in Morphic >you can use an ImageMorph. 

>> #2 how would you make the program draw where your mouse pointer is? I
>> think 
>> you do it like: 
>> myPen goto: 200 at 200.	but more like: myPen goto: mouseX at mouseY 

>Your morph can receive mouse events. You need to implement the
handlesMouseDown: method to return >true. 

>This will send mouse event messages to your morph. It will receive a
mouseDown: message when the >mouse button is pressed, and a mouseMove:
message when the mouse is moved subsequently, and >finally a mouseUp:

>The argument to these messages is a MouseEvent. It has a position, but that
is in world coordinates. You >need to subtract the morph's topLeft
coordinate from the event's position. 
I will try this as soon as I have time!

>It's really just a handful of lines, but see the attached example for a
working version. 
I just opened it in a text editor :O that is not many lions at all!
>- Bert - 

I just have one more question how do I actually file in some thing. my dad
and I spent ages trying to find that out so we just exchanged Images  
thanks so much for your help!

Under the age of 15 so don't want to post my name :D
View this message in context: http://forum.world.st/Help-with-pen-stuff-tp4633281p4633334.html
Sent from the Squeak - Beginners mailing list archive at Nabble.com.

More information about the Beginners mailing list