First on my list for today was to generalise the "highlight on mouseover" code that we use to indicate what’s clickable on the screen (a convention we borrowed from Gcompris). The existing code had a lot of duplication because I’d subclassed a lot of standard graphic objects (Ellipse, Rectangle, Image, etc) to tack on mouseEnter: and mouseLeave: methods to switch the colour scheme. I’d planned to replace this with some fancy pixel-scraping Smalltalk code that’d probably take half a day to write for a relative newbie like me.

Happily I realised this morning that I don’t need to write any Smalltalk at all! I can take any standard geometric object and add a pair of one-line Etoys scripts to switch colours on mouseEnter/mouseLeave. This seems obvious in retrospect but I’ve only recently learned that scripts can be activated automatically on mouse and keyboard events (if you look at the picture closely you’ll see where). I think I picked up this trick from reading Etoys-blogger extraordinaire Bill Kerr’s blog. I’m tempted to praise Bill Kerr as the Bill Clementson of Etoys but perhaps the reference is too Lisp-centric
So anyway: I finished today’s main TODO item before breakfast and celebrated with a leisurely unicycle ride through sunny Patan and into our office. Life is good!
P.S. If you want to join in the Etoys fun at home you should check out the introductory tutorial videos at waveplace.com.
0 responses so far ↓
There are no comments yet...Kick things off by filling out the form below.
Leave a Comment