squeaking for help!

Mayer Goldberg gmayer at cs.bgu.ac.il
Thu Jun 20 17:16:05 UTC 2002


Dear Squeakers:

While working through the of the drawing examples in Mark Guzdial's
"Squeak: Object-Oriented Design with Multimedia Applications", I seem
to have slipped into a swamp:

- The Form>>fillWhite method isn't defined in the most recent version
  of Squeak. "No big deal" I thought, and decided that this would be a
  good learning experience, trying to define such a [trivial] method.

- I studied the classes Form and Color to make sure how things work. I
  then created a class called (sorry) GuzdialForm, which is a subclass
  of class Form, and which has only the fillWhite method:

fillWhite
	| whiteColor |
	whiteColor := (Color r: 1.0 g: 1.0 b: 1.0)
			     pixelValueForDepth: self depth
	1 to: self bits do: [:i | self pixelValueAt: i put: whiteColor].

But alas, this didn't work: I get an error: Improper store into
indexable object... I tried moving up and down in the debugger, but I
couldn't tell anything useful beyond the fact that the error occurred
in pixelValueAt:put: ... The problem *I* am having is that right after
I attempt to change the pixel value, I jump to another method
SmallInteger>><= and I can't tell who invoked it! I tried to
single-step, but got a "code simulation error" -- another ball game
altogether.

Does this make any sense to you? What should I have done to detect
what I'm doing wrong?

Thanks!

Mayer



More information about the Squeak-dev mailing list