Skip navigation.
 
mlsetAutoresizingMask from code
FROM : Aby
DATE : Sat Feb 02 12:27:21 2008

Hi,
I have created one controller for my window which is a subclass of
NSWindowController

and added one button to the window and added the following code to the
Action event.

NSBox *newBox = [[NSBox alloc] initWithFrame:NSMakeRect(10.0f, 10.0f, 200.0f,
200.0f)];

[newBox setBoxType:NSBoxPrimary];


[myBox setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable ];

[[[self window] contentView] addSubview:newBox];

this will add the box to the content view of the window. but not he
autoresizing mask.

but if I set the auto resizing from the IB for any control on the Window say
for this button then the above code works fine.

How to set the resize state  on from code.

Regards
Tom.

Related mailsAuthorDate
mlsetAutoresizingMask from code Aby Feb 2, 12:27
mlRe: setAutoresizingMask from code Aby Feb 2, 16:56
mlRe: setAutoresizingMask from code Quincey Morris Feb 3, 05:04