How to resize accessory view to match Open panel
How to resize accessory view to match Open panel
- Subject: How to resize accessory view to match Open panel
- From: Jonathan Taylor <email@hidden>
- Date: Wed, 08 Jul 2015 16:33:55 +0100
I feel this should be a simple question, but I cannot find an answer that works.
I have an open panel to which I am trying to add an accessory view. That much works. However I would like the accessory view to resize to fit the width of the parent window. It’s just a textual description, after all.
An old thread here:
http://www.cocoabuilder.com/archive/cocoa/106875-setaccessoryview.html
suggests this is not trivial to do.
I have tried the suggested monitoring of NSWindowDidResizeNotification (and also tried NSViewFrameDidChangeNotification), and these don’t seem to work quite right. There have been plenty of OS changes since that thread was written, so probably no surprises there.
What happens is that it doesn’t seem possible to *shrink* the Open window (I guess the ‘hard’ size that I am setting for my view is affecting the minimum size of the overall window) and, much more alarmingly, I get crashes when resizing.
The alternative suggestion related to IB struts doesn’t seem to work for me either. I set all four edge struts and tried both with and without the ‘resizeable’ arrows in the middle of the view. No effect.
Can anyone advise on the current and correct way of getting the accessory view to resize appropriately? It seems this should be a common desired behaviour, but haven’t had any luck doing it or finding any recent examples/advice on google…
Thanks
Jonny
_______________________________________________
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