Re: Auto Layout on NSWindow: Window title width isn't adjusted
Re: Auto Layout on NSWindow: Window title width isn't adjusted
- Subject: Re: Auto Layout on NSWindow: Window title width isn't adjusted
- From: Quincey Morris <email@hidden>
- Date: Tue, 12 Apr 2016 19:36:21 -0700
- Feedback-id: 167118m:167118agrif8a:167118ss3CMkNL15:SMTPCORP
On Apr 11, 2016, at 23:39 , Ulf Dunkel <email@hidden> wrote:
I am wondering how I could adjust Auto Layout in order to have the width of my NSWindow automatically adjusted to the width of the NSWindow title. In some localization cases, it is longer than any object in the NSWindow view, but shouldn't be abbreviated by "...".
I dunno if there’s a direct way, but I was going to suggest that you add a text field to the window that has the same text as the window title, position it outside the content view, then tie the window’s minimum width to this text field’s width. It’s not obvious this will necessarily work, and you might have to take some care that (for example) the non-visible field didn’t cause confusion with accessibility.
But if you’re going to do that, then the non-hacky way would be to add a simple minimum width constraint to the window’s content view and adjust the value at runtime. I think if you just setNeedsLayout after changing the constraint, the window should then resize itself to honor the minimum.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden