• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Apps whitout nib
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Apps whitout nib
      • From: j o a r <email@hidden>
    • Re: Apps whitout nib
      • From: James Chen <email@hidden>
  • Prev by Date: NSFontManager's delegate.
  • Next by Date: Re: Slow Cocoa
  • Previous by thread: [SOLVED]: NSFontManager's delegate.
  • Next by thread: Re: Apps whitout nib
  • Index(es):
    • Date
    • Thread