Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

printf

macrumors regular
Original poster
Aug 27, 2008
105
0
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:
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
 
Apparently if you want the whole view flipped the NSView Class Reference has this...
isFlipped
Returns YES if the receiver uses flipped drawing coordinates or NO if it uses native coordinates.

- (BOOL)isFlipped

Discussion
The default implementation returns NO; subclasses that use flipped coordinates should override this method to return YES.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.