Hello ...
I have a text field (NSTextView, actually) in a vertically-resizable window. Normally, I want the field's bottom edge to keep a constant distance from the window's bottom edge; using Interface Builder to set the field's resizing info with a "height spring" does the trick.
I also have a "smaller window" mode in which the window's bottom edge rides closer to the field's bottom edge. In transitioning to this mode, I want the field to stay put and have the window "shrink up" to it. So, before sending -setFrame:display:animate: to the window, I want to replace the field's "height spring" with a "strut", and its "bottom margin strut" to a "spring".
In Interface Builder, both spring/strut arrangements work as expected. However, I can't seem to get my code to make on-the-fly changes:
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
- (<font color = green>void</font>)shrinkWindow
{
[...]
<font color = brown>// Field originally set with <font color = red>"height spring"</font>.</font>
<font color = brown>// During transition, I want the <font color = red>"bottom margin spring"</font>,</font>
<font color = brown>// then I reset the <font color = red>"height spring"</font>.</font>
[myFld setAutoresizingMask:NSViewMinYMargin];
[myWindow setFrame:aRect display:<font color = purple>YES</font> animate:<font color = purple>YES</font>];
[myFld setAutoresizingMask:NSViewHeightSizable];
}
</font>[/code]
What am I missing here?
Thanks,
DayLateDon