ImageMorph scaling

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

ImageMorph scaling

Sean P. DeNigris
Administrator
How would I get an ImageMorph to automatically resize inside a Spec UI? I put it in a PanelMorph with various layout attempts, the latest being:
        image := PanelMorph new
                changeTableLayout;
                hResizing: #spaceFill;
                vResizing: #spaceFill;
                yourself.

Where image above is an accessor referenced in #spec

Then I added:
        imageMorph := ImageMorph new
                image: form;
                hResizing: #spaceFill;
                vResizing: #spaceFill;
                yourself.

        image addMorph: imageMorph.

The form shows up as the full original size, but strangely if I bring up the halos on the ImageMorph and just wiggle the scaling halo, it resizes to fit the PanelMorph. But then if I resize the window again, the image doesn't rescale.

Thanks.
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: ImageMorph scaling

Denis Kudriashov
Hi

I think ImageMorph not support #spaceFill resizing


2013/11/5 Sean P. DeNigris <[hidden email]>
How would I get an ImageMorph to automatically resize inside a Spec UI? I put
it in a PanelMorph with various layout attempts, the latest being:
        image := PanelMorph new
                changeTableLayout;
                hResizing: #spaceFill;
                vResizing: #spaceFill;
                yourself.

Where image above is an accessor referenced in #spec

Then I added:
        imageMorph := ImageMorph new
                image: form;
                hResizing: #spaceFill;
                vResizing: #spaceFill;
                yourself.

        image addMorph: imageMorph.

The form shows up as the full original size, but strangely if I bring up the
halos on the ImageMorph and just wiggle the scaling halo, it resizes to fit
the PanelMorph. But then if I resize the window again, the image doesn't
rescale.

Thanks.



-----
Cheers,
Sean
--
View this message in context: http://forum.world.st/ImageMorph-scaling-tp4719248.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.


Reply | Threaded
Open this post in threaded view
|

Re: ImageMorph scaling

Camillo Bruni-3
In reply to this post by Sean P. DeNigris
Check what magic Ben applied for the Morph Inspector:
`World inspect` then switch to morph view.


On 2013-11-05, at 05:04, Sean P. DeNigris <[hidden email]> wrote:

> How would I get an ImageMorph to automatically resize inside a Spec UI? I put
> it in a PanelMorph with various layout attempts, the latest being:
> image := PanelMorph new
> changeTableLayout;
> hResizing: #spaceFill;
> vResizing: #spaceFill;
> yourself.
>
> Where image above is an accessor referenced in #spec
>
> Then I added:
> imageMorph := ImageMorph new
> image: form;
> hResizing: #spaceFill;
> vResizing: #spaceFill;
> yourself.
>
> image addMorph: imageMorph.
>
> The form shows up as the full original size, but strangely if I bring up the
> halos on the ImageMorph and just wiggle the scaling halo, it resizes to fit
> the PanelMorph. But then if I resize the window again, the image doesn't
> rescale.
>
> Thanks.
>
>
>
> -----
> Cheers,
> Sean
> --
> View this message in context: http://forum.world.st/ImageMorph-scaling-tp4719248.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>


signature.asc (457 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ImageMorph scaling

Sean P. DeNigris
Administrator
In reply to this post by Sean P. DeNigris
Sean P. DeNigris wrote
How would I get an ImageMorph to automatically resize inside a Spec UI?
The following must be called /after/ the ImageMorph is added to the parent...
        imageMorph addFlexShell
                hResizing: #spaceFill;
                vResizing: #spaceFill.

The resizing is a bit slow, but it works. HTH...
Cheers,
Sean