cocoa vertical orientation issue

Discussion in 'Mac Programming' started by printf, May 16, 2010.

  1. printf macrumors regular

    Aug 27, 2008
    all my googling using the word orientation returns iphone results, but i'm referring to programmatic creation of controls being placed at the bottom of the window when y is set to 0. i want the opposite of that. i want the y value to be the offset from the top.

    sample code:
    	NSView *superview = [window contentView]; 
    	NSRect frame = NSMakeRect(10, 0, 100, 20); //<-- puts button on bottom
    	NSButton *button = [[NSButton alloc] initWithFrame:frame]; 
    	[button setTitle:@"OK"]; 
    	[superview addSubview:button]; 
    	[button release];	
    i know with carbon i had to flip the orientation for cgcontext, is there something similar i can do here? preferably a property i'll only have to set once. thx
  2. xStep macrumors 68000

    Jan 28, 2003
    Less lost in L.A.
    Apparently if you want the whole view flipped the NSView Class Reference has this...

Share This Page