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

MythicFrost

macrumors 68040
Original poster
Mar 11, 2009
3,944
40
Australia
Hi,

I've got a NSTextField that I've added to my window:
Code:
lConvert = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 100, 20)];
But, it shows up at the bottom left of the screen, when in my mind it should be at the top left.

I thought I might need to anchor it (I'm not sure the proper term, but it's in interface builder, Size & Position, just above AutoResizingMask).

I've looked through the documentation for this and I can't find it, any idea's?

Kind Regards
 
By default, a view's origin is bottom-left. To get the origin to be in the top-left, you have to override the superview's -isFlipped method and return YES.
 
Thank you, I realised how to get it up the top without doing so. My code was pushing it up too high so I couldn't see it, which is fixed now.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.