[BUG][FIX] YellowButtonBit and BlueButtonBit are swapped
Andreas Raab
Andreas.Raab at gmx.de
Wed Mar 6 01:07:21 UTC 2002
> > A subclass of Rectangle
> >
> > red click -> background color switches to red
> > yellow click -> yellow
> > blue click -> blue
> >
> > Implementing this would actually be a nice exercise for a
> > new squeaker. (An old Squeaker like Bob Arning and Ned Konz would
> > probably need 15 minutes, while a newbie would probably need an
afternoon).
> > It would as well make a good topic for writing a tutorial.
>
> Cute. (It actually only takes a minute or two -- just implement
> mouseDown:, handlesMouseDown:, and blueButtonDown: .)
A minute? Hm ... how long does it take to type:
m := Morph new.
m on: #mouseDown send: #value: to:[:evt|
evt redButtonPressed ifTrue:[m color: Color red].
evt yellowButtonPressed ifTrue:[m color: Color yellow].
evt blueButtonPressed ifTrue:[m color: Color blue].
].
m openInWorld.
;-)
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|