Re: scale text proportionally as bounds increase
Re: scale text proportionally as bounds increase
- Subject: Re: scale text proportionally as bounds increase
- From: Steve Mills <email@hidden>
- Date: Mon, 23 Feb 2015 10:56:24 -0600
On Feb 23, 2015, at 10:49:36, sqwarqDev <email@hidden> wrote:
>
> I need some advice on how to approach a particular problem (OS X),
>
> I have a basic window with a couple of NSTextFields and Labels. What I want to do is have the user able to drag the window frame and have the text in the fields increase proportionally. I know I can get the frame of each NSControl within the superview to scale with AutoLayout, but that won't increase the text size within the NSControl.
>
> How do I programmatically tell each NSControl to increase its text size proportionally as its bounds increase?
I haven't tried this, but you should be able to hook the field's Font Size binding up to a custom NSValueTransformer, which would return a size based on a base minimum font size plus a scale factor based on the current dimension / minimum dimension.
--
Steve Mills
Drummer, Mac geek
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden