Re: Window Placement
Re: Window Placement
- Subject: Re: Window Placement
- From: Stéphane Sudre <email@hidden>
- Date: Thu, 7 Nov 2002 16:57:39 +0100
On jeudi, nov 7, 2002, at 12:56 Europe/Paris, email@hidden wrote:
I'm trying to use the following code to get a perfect placement for my
window:
NSRect *d;
NSScreen *screen = [NSScreen mainScreen];
d = [screen frame];
[[winControl window] setFrame:[NSRect x:[[d width]/2-500/2] y:[[d
height]/2-500/2] w:700 h:500] display:NO];
But for some reason I get 2 errors trying to run it:
following
AppController.m:121: incompatible types in assignment
AppController.m:122: parse error before "NSRect"
Wrong code:
[[winControl window] setFrame:[NSRect x:[[d width]/2-500/2] y:[[d
height]/2-500/2] w:700 h:500] display:NO];
NSRect is not a class. I don't know where you found the x:y:w:h: method.
[[d width]/2-500/2]
Too many []
[[winControl window] setFrame:NSMakeRect([d width]*0.5-250, [d
height]*0.5-250,700,500)];
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.