I can't display a numer of Forms on a Form
Trygve Reenskaug
trygver at ifi.uio.no
Fri Apr 9 07:29:04 UTC 2004
Many thanks, it worked.
I spent a good day experimenting with various uses of
WindowingTransformation, but it didn't occur to me to experiment with the
display defaults. It all makes sense, in hindsight.
Much can be said about Squeak, most of it unfairly. I said some of it
during my unsuccessful experiments yesterday. But the Squeak community is
very helpful and supportive and saves the day.
Again, many thanks
--Trygve
At 08.04.2004 18:45, you wrote:
>"Trygve Reenskaug" <trygver at ifi.uio.no> wrote
><snip>
> > I want to display a number of pictures on aForm scaled and moved to fit
> > within given rectangles.
></snip>
><snip>
> > Here's the code. The resulting red and blue rectangles are o different in
> > both size and position.
> >
> >
> > buildObjectsCompositeForm2
> > " R23CompositeMorph buildObjectsCompositeForm2 "
> > | form frames |
> > frames := { 6 at 2 corner: 449 at 238.
> > 186 at 210 corner: 434 at 390.
> > 505 at 218 corner: 653 at 388. }.
> > form := Form extent: 700 at 500 depth: 8.
> > form fillWithColor: Color yellow.
> > frames do:
> > [:frame || subForm |
> > subForm := Form extent: frame extent depth: 8.
> > subForm fillWithColor: Color red.
> > subForm
> > displayOn: form
> > transformation:
> > (WindowingTransformation window: subForm boundingBox
>viewport:
> > frame)
> > clippingBox: (form boundingBox)].
> > frames do:
> > [:frame || subForm |
> > subForm := Form extent: frame extent * 2 depth: 8.
> > subForm fillWithColor: Color blue.
> > subForm
> > displayOn: form
> > transformation:
> > (WindowingTransformation window: subForm boundingBox
>viewport:
> > frame)
> > clippingBox: (form boundingBox)].
> >
> > form displayAt: 10 at 10.
> >
>
>#displayOn:transformation:clippingBox:
>is inherited from DisplayObject, it calls
>
>Form>>displayOn: transformation:clippingBox:
>align:with:rule:fuillColor.
>
>I think the align:with: is not what you need. At this
>moment I fell myself unable to give you an example
>where the alignment is helpful.
>.
>For better results, please try
> subForm
> displayOn: form
> transformation:
> (WindowingTransformation window: subForm boundingBox viewport:
>frame)
> clippingBox: (form boundingBox)
> align: 0 at 0
> with: 0 at 0
> rule: Form over
> fillColor: nil
>
>
>Greetings, Boris
--
Trygve Reenskaug mailto: trygver at ifi.uio.no
Morgedalsvn. 5A http://heim.ifi.uio.no/~trygver
N-0378 Oslo Tel: (+47) 22 49 57 27
Norway
More information about the Squeak-dev
mailing list
|