Re: From Carbon to Cocoa
Re: From Carbon to Cocoa
- Subject: Re: From Carbon to Cocoa
- From: Shawn Erickson <email@hidden>
- Date: Tue, 20 Jul 2004 13:42:50 -0700
On Jul 20, 2004, at 12:57 PM, Tim Conkling wrote:
As a new Cocoa developer, I'm having a bit of difficulty figuring out
how to do things the Cocoa way -- my brain is stuck in Carbon-land.
Trying to figure out how to programatically make an NSWindow visible,
for example, took me a long time -- I was looking for methods like
show:, makeVisible:, setVisible:, etc, until I finally stumbled on
makeKeyAndOrderFront:, which does what I want (well, it displays the
window) but has a name that confuses the heck out of me.
I'm wondering if someone has taken it upon themselves to write a
"Cocoa for Carbon Programmers" guide that describes the Cocoa method
of doing common things like displaying a window. Apple's Cocoa
documentation is great, but all of a sudden I feel like I did back
when I was first learning the Toolbox -- that is, it's hard for me to
even know where to look to find information on basic tasks.
Specifically, I'm currently trying to figure out the relationship
between NSWindows, NSViews, and CGContexts so that I can use Quartz
APIs (also new to me; I'm used to QD) to draw things into a window.
In my opinion a way to attack this is to forget you ever knew Carbon,
don't try to find parallels. Learn it from a clean slate and then look
back towards Carbon afterwards.
In regards to understanding QuickDraw to Quartz review the following...
<
http://developer.apple.com/documentation/Carbon/Conceptual/
QuickDrawToQuartz2D/index.html>
Also make sure to review the conceptual documentation about Cocoa (they
are getting more and more fleshed out)...
<
http://developer.apple.com/documentation/Cocoa/DesignGuidelines-
date.html>
...but scan the following first...
<
http://developer.apple.com/referencelibrary/GettingStarted/GS_Cocoa/
index.html>
Any particular reason why you want to use the Quartz APIs directly and
not Cocoa's near equivalents? (NSBezierPath, NSImage, NSShadow, the
NSControl/NSView sub-classes, etc.).
I believe the following does a good job of outlining how AppKit deals
with drawing...
<
http://developer.apple.com/documentation/Cocoa/Conceptual/DrawViews/
index.html> &&
<
http://developer.apple.com/documentation/Cocoa/Conceptual/DrawBasic/
index.html> &&
<
http://developer.apple.com/documentation/Cocoa/Conceptual/DrawImages/
index.html>
Finally some folks find this way of looking at things helpful...
<
http://developer.apple.com/documentation/Cocoa/Reference/Foundation/
ObjC_classic/Intro/IntroFoundation.html>
<
http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/Intro/IntroAppKit.html>
-Shawn
_______________________________________________
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.