Apps whitout nib
Apps whitout nib
- Subject: Apps whitout nib
- From: Wezzy <email@hidden>
- Date: Tue, 17 Feb 2004 01:08:06 +0100
HI, i'm playing with building apps without usign IB. This small code
seems to work but it shows a very strange windows, it is perfectly
rectangular (no rounded corners) and the NSButton instance inside
appears trasparent. Well i can read the string "Button" but this is the
only thing that i see. All around i see the metal background :-(
Where is(are) my error(s) ?
Thanks for your time.
Wezzy
import <Cocoa/Cocoa.h>
int main()
{
NSWindow * win;
NSApplication * app;
NSRect contentRect;
NSButton * bt;
NSAutoreleasePool * pool;
pool = [[NSAutoreleasePool alloc] init];
contentRect = NSMakeRect(0,0,330,330);
win = [[NSWindow alloc] initWithContentRect:contentRect
styleMask:(NSTexturedBackgroundWindowMask | NSTitledWindowMask |
NSClosableWindowMask | NSMiniaturizableWindowMask)
backing:NSBackingStoreNonretained defer:1];
bt = [[NSButton alloc] initWithFrame:contentRect];
[win setTitle:@"Test Window"];
[win setContentView:bt];
[win setDelegate:bt];
//[win makeKeyAndOrderFront:nil];
app = [NSApplication sharedApplication];
[app runModalForWindow:win];
[app release];
[pool release];
}
_______________________________________________
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.