[Newbies] Someone to critique my custom Morph?

trilobyte at hoe.nu trilobyte at hoe.nu
Wed Mar 21 15:18:07 UTC 2007


I have made a custom Morph to look for keyboard events when it is the
current mouse focus.  Is there anyone out there who could look at my class
and give me suggestions / observations?

I am wondering if I made any bad practices or bad oversights.  My
techniques were culled from a number of different tutorials and looking at
existing classes.  I have implemented it on a 3.6-based image.

I appreciate any help.

I will attach the class which you can file-in.  It is called
"KeyMoverMorph" and is in the category "My Morph".  Its behavior includes:

- drawing a border when it is mouse focus
- looking for keyboard events when it is mouse focus
- changes to color yellow when 'o' is pressed on it, blue when 'c' is pressed
- when it is focus, keyboard arrow keys move it up, down, left, and right

If there are better ways for me to do any of these things please let me know.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: KeyMoverMorph.st
Type: application/octet-stream
Size: 1831 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/beginners/attachments/20070321/26ac9770/KeyMoverMorph.obj

More information about the Beginners mailing list