Re: Can't make window.
Re: Can't make window.
- Subject: Re: Can't make window.
- From: David Remahl <email@hidden>
- Date: Mon, 10 Feb 2003 19:33:49 +0100
Thanks for the help in creating a custom window.
Heh, heh, typing code to make windows, just like the good old days!
But what's wrong with this (unknown message selector):
------------------
NSRect rect = NSMakeRect(20, 20, 200, 200);
NSWindow *wind;
[wind
initWithContentRect:rect:NSBorderlessWindowMask:NSBackingStoreBuffered:
t
rue];
The documentation says:
- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned
int)styleMask backing:(NSBackingStoreType)backingType defer:(BOOL)flag
You seem not to understand the basic syntax of sending messages in
objective-C.
You should send the message ("call the method") like this:
NSWindow *wind = [[wind alloc] initWithContentRect:rect
styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered
defer:YES];
That is, you should include the "parameter names" (which are actually
part of the method name!), not just specify the arguments. Also, you
need to first allocate the window before calling -init on it.
You really should read ObjC.pdf, which is Apple's introduction and
reference to the objective C language:
/Developer/Documentation/Cocoa/ObjectiveC/ObjC.pdf
/ Regards, David
_______________________________________________
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.