Re-doing Morphic ( Was: Re: Traits prototype image )
daniel.a.joyce at worldnet.att.net
Tue Feb 11 06:53:35 UTC 2003
On Monday 10 February 2003 08:20 pm, Steven Swerling wrote:
> Andreas Raab wrote:
> [snip have been applied]
> The Morphic framework doesn't need cleaning? Just look at this
> comment from SimpleButton>>mouseUp:
> "if oldColor nil, it signals that mouse
> had not gone DOWN inside me, e.g. because
> of a cmd-drag; in this case we want to avoid
> triggering the action!"
> This is how SimpleButton, the button that 4 out of 5 squeak
> programmers recommend for their patients that use buttons, determines
> to fire an event that the user has clicked the button -- by checking
> whether the oldColor instance variable is nil. That ain't a problem
> with smalltalk. I'm not sure if it is somehow eToy related, but
> whatever it is, it's just plain ugly. I dare anyone whose initials
> are not DI, AR, RA, DW, or NK to streamline this code and submit a
> change set, and see if it get's in.
See! This is exactly what I'm talking about... It's not logical what
happens if a Simple button morph has the same 2 colors for
pressed/unpressed. Or what if it contains an image. Thing is, Simple
Button Morph would likely break in that case.
But then someone writes "Picture Button Morph", etc etc. Hey, why not
have a button morph that takes a pluggable chunk of code for rendering
what it looks like pressed/unpressed, and also provides a nice default
render behaviour? ;)
And morphic is full of stuff like this. All the stuff about
"refactoring" and "patterns" is nowhere to be seen in Morphic...
More information about the Squeak-dev