I want to fill rectangles with stripes. What's a good way to do this?
It looks as if I might want to use FillStyle's, but Morph>>fillStyle: has the comment "Workaround for Morphs not yet converted"
This suggests fillStyle is on the way out, but I don't know what the conversion is from or to.
When I try the following, I get a very mottled looking background: |a b c| a _ Form extent: 4@4 depth: 32. c _ Color red. a colorAt: 3@1 put: c; colorAt: 4@1 put: c; colorAt: 2@2 put: c; colorAt: 3@2 put: c; colorAt: 1@3 put: c; colorAt: 2@3 put: c; colorAt: 1@4 put: c; colorAt: 4@4 put: c. b _ RectangleMorph new. b color: (InfiniteForm with: a). b openInHand.
I've also tried vertical stripes (the preceding attempts diagonal stripes), but I get the same irregular results. Perhaps InfiniteForm's do not line up as I would expect?
On Wed, 29 Aug 2001, Ross Boylan wrote:
I want to fill rectangles with stripes. What's a good way to do this?
It looks as if I might want to use FillStyle's, but Morph>>fillStyle: has the comment "Workaround for Morphs not yet converted"
This suggests fillStyle is on the way out, but I don't know what the conversion is from or to.
Nah, it means there might be morphs only understanding the old "color:" protocol. Fillstyles are the way to go.
When I try the following, I get a very mottled looking background: |a b c| a _ Form extent: 4@4 depth: 32. c _ Color red. a colorAt: 3@1 put: c; colorAt: 4@1 put: c; colorAt: 2@2 put: c; colorAt: 3@2 put: c; colorAt: 1@3 put: c; colorAt: 2@3 put: c; colorAt: 1@4 put: c; colorAt: 4@4 put: c. b _ RectangleMorph new. b color: (InfiniteForm with: a). b openInHand.
I've also tried vertical stripes (the preceding attempts diagonal stripes), but I get the same irregular results. Perhaps InfiniteForm's do not line up as I would expect?
Your code is all correct, but colorAt: is zero-based ... :)
-- Bert
squeak-dev@lists.squeakfoundation.org