I asked this question a little while back, but probably not in a clear or smart 
way. I hope I can explain what I need better this time.

In the process of localising my app, i find that I need some sheets and some 
popovers to have different sizes, depending on the user's chosen language. 
Mostly, I need increased width and/or height when the language is not English. 
I've watched the auto layout related videos from WWDC 2012 and 2011, and am 
able to create layouts that, when the window is resized will limit how far it 
can be resized down vertically and horizontally, but what I need is for windows 
to be loaded from nibs and open in a size larger than the size saved in the nib 
when it was created, rather than resized by the user.

Currently, in awakeFromNib, I adjust all user facing interface elements to the 
target language, and I had hoped that with wider, and sometimes higher 
controls, the containing sheet/popover would automatically resize to compensate 
for the larger dimensions. It doesn't. I find I need to calculate the new size 
of the container and set it manually.

Is there a way to specify auto layout settings such that all this is taken care 
of automatically by the autlayout system?

The app requires 10.7 and up, so I'd rather not use 10.8 specific enhancements 
to auto layout.

To be explicit, lets say I have a very simple popover with a label followed by 
a text field:

|-20-[some label]-8-[some text field]-20-|

In the nib, which is laid out for the English language, the layout has a 
certain width:

Lets say the label  as laid out in the nib file has width 80 and the text field 
has width 120    =>   total width = 20+80+8+120+20 = 248

Let's say the user's system is set to French, the label now needs width 110, 
resulting in a total required width of 278.

Ideally,  controls' containers would resize from 248 to 278, after the 
localisation during loading of the nib, but before the sheet or popover is 
shown to the user. As it is, I see that the label has resized, after changing 
its stringValue, and the text field has moved out of the way towards the right, 
but since the container has not, the text field is clipped by the window's 
bounds.

-António

-----------------------------------------------------------
Don't believe everything you think
-----------------------------------------------------------





_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to