• 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
Re: Minimal cocoa application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Minimal cocoa application


  • Subject: Re: Minimal cocoa application
  • From: Joshua Orr <email@hidden>
  • Date: Thu, 8 Mar 2007 08:29:31 -0700


On Mar 8, 2007, at 7:23 AM, John C. Randolph wrote:


On Mar 8, 2007, at 3:14 AM, Godwin, Mark R wrote:

What I would like to know is, what is the absolute minimum I need to do
to create a window in Cocoa, and fill it with, for instance, a WebView?

// theScreen Is a NSScreen instance, indicating which monitor to put the window on...
screenRect = [theScreen frame];
screenRect.origin.x = 0;
screenRect.origin.y = 0;



// Here you can choose various options when you make your window, including what screen it will show up on (if there are multiple monitors attached)...
mainWindow = [[NSWindow alloc] initWithContentRect:screenRect// NSMakeRect(20, 500, 400, 400)//screenRect
styleMask:NSBorderlessWindowMask // NSTitledWindowMask// NSBorderlessWindowMask
backing:NSBackingStoreBuffered // NSBackingStoreRetained //NSBackingStoreBuffered
defer:NO screen:theScreen /* [NSScreen mainScreen]*/];


// Set the background color if you want...
[mainWindow setBackgroundColor:[NSColor blackColor]];


// set the window level if needed (I do this for a full screen app that always has to be above everything else)...
[mainWindow setLevel:CGShieldingWindowLevel()];


	// Bring the window up...
    [mainWindow makeKeyAndOrderFront:nil];

// Set the content view, in this case I am using a custom movie view subclass instance...
[mainWindow setContentView:[self returnNewMovieView]];



This is sort of ruff, but gives you a start at least. _______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Minimal cocoa application (From: "Godwin, Mark R" <email@hidden>)
 >Re: Minimal cocoa application (From: "John C. Randolph" <email@hidden>)

  • Prev by Date: Re: Multi-threaded help
  • Next by Date: RE: Minimal cocoa application
  • Previous by thread: Re: Minimal cocoa application
  • Next by thread: Re: Minimal cocoa application
  • Index(es):
    • Date
    • Thread