Creating a NSWindow programatically in Cocoa

5

Posted by Jaime | Posted in Coding | Posted on 14-05-2008

Tags: , , ,

Here is something that I haven’t found on the web: an example of how to create a NSWindow programatically from Cocoa. After a little bit of reading, and some head scratching, this is what I got:

NSRect windowRect = NSMakeRect(10.0f, 10.0f, 800.0f, 600.0f);
 
NSWindow *window = [[NSWindow alloc] initWithContentRect:windowRect 
styleMask:( NSResizableWindowMask | NSClosableWindowMask | NSTitledWindowMask) 
backing:NSBackingStoreBuffered defer:NO];
 
[window makeKeyAndOrderFront:nil];
 

There was another website where I saw some sample code that helped, so here it is: 
http://www.mp3car.com/vbulletin/maccar/73352-some-cocoa-xcode-help.html

Maybe helping our planet, a little bit

0

Posted by Jaime | Posted in What's New | Posted on 01-05-2008

Tags: , , , ,

This is not an advertisement. I’ve been looking around for companies that provide SVN hosting and I stumbled on this company that claims to be 100% Carbon Neutral: http://www.dreamhost.com/. This is an interesting idea and I actually felt good about the prospect of doing business with a company that actually cared about the environment. Now, I actually haven’t checked out there credentials and how they were accomplishing this Carbon neutrality, but it looks like a good idea.

 

When I typed 100% Carbon Neutral Hosting in Google, I also found this (http://www.thinkhost.com/) which seems like a really proactive approach: getting your power from wind! Swoosh!