Maintaining Aspect Ration of a Window


Dave
 

Mac, Manual Layout of Views.

Hi All,

Is there anyway to ensure that when a window resizes on the Mac it maintains its aspect ratio? I’m doing manual layout as for this project Auto Layout isn’t viable, so I guess I am really asking, is there anyway of stopping the Window resizing in response to the user dragging one of the edges?

Thanks in advance.

All the Best
Dave


Andy Lee
 

Yes, there is a window delegate method.  Given a proposed window size, you return the actual window size you would like to constrain to.


--Andy


On Mon, Sep 17, 2018, at 7:32 AM, Dave wrote:
> Mac, Manual Layout of Views.
>
> Hi All,
>
> Is there anyway to ensure that when a window resizes on the Mac it
> maintains its aspect ratio? I’m doing manual layout as for this project
> Auto Layout isn’t viable, so I guess I am really asking, is there anyway
> of stopping the Window resizing in response to the user dragging one of
> the edges?
>
> Thanks in advance.
>
> All the Best
> Dave
>
>
>
>


Dave
 

Thanks a lot, I was looking for the wrong method!

On 17 Sep 2018, at 14:23, Andy Lee via Groups.Io <aglee@...> wrote:

Yes, there is a window delegate method.  Given a proposed window size, you return the actual window size you would like to constrain to.


--Andy


On Mon, Sep 17, 2018, at 7:32 AM, Dave wrote:
> Mac, Manual Layout of Views.
>
> Hi All,
>
> Is there anyway to ensure that when a window resizes on the Mac it
> maintains its aspect ratio? I’m doing manual layout as for this project
> Auto Layout isn’t viable, so I guess I am really asking, is there anyway
> of stopping the Window resizing in response to the user dragging one of
> the edges?
>
> Thanks in advance.
>
> All the Best
> Dave
>
>
> 
>



Sandor Szatmari
 

On Sep 17, 2018, at 08:55, Dave <dave@...> wrote:

Thanks a lot, I was looking for the wrong method!

On 17 Sep 2018, at 14:23, Andy Lee via Groups.Io <aglee@...> wrote:

Yes, there is a window delegate method.  Given a proposed window size, you return the actual window size you would like to constrain to.


--Andy


On Mon, Sep 17, 2018, at 7:32 AM, Dave wrote:
> Mac, Manual Layout of Views.
>
> Hi All,
>
> Is there anyway to ensure that when a window resizes on the Mac it
> maintains its aspect ratio? I’m doing manual layout as for this project
> Auto Layout isn’t viable, so I guess I am really asking, is there anyway
> of stopping the Window resizing in response to the user dragging one of
> the edges?
>
> Thanks in advance.
>
> All the Best
> Dave
>
>
> 
>



Dave
 

Thanks a lot, I think this should do the trick!

On 17 Sep 2018, at 15:03, Sandor Szatmari <admin.szatmari.net@...> wrote:

Try -aspectRatio


Does that do what you want?

Sandor

On Sep 17, 2018, at 08:55, Dave <dave@...> wrote:

Thanks a lot, I was looking for the wrong method!

On 17 Sep 2018, at 14:23, Andy Lee via Groups.Io <aglee@...> wrote:

Yes, there is a window delegate method.  Given a proposed window size, you return the actual window size you would like to constrain to.


--Andy


On Mon, Sep 17, 2018, at 7:32 AM, Dave wrote:
> Mac, Manual Layout of Views.
>
> Hi All,
>
> Is there anyway to ensure that when a window resizes on the Mac it
> maintains its aspect ratio? I’m doing manual layout as for this project
> Auto Layout isn’t viable, so I guess I am really asking, is there anyway
> of stopping the Window resizing in response to the user dragging one of
> the edges?
>
> Thanks in advance.
>
> All the Best
> Dave
>
>
> 
>