Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-12

Carbon vs Cocoa

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

This is not strictly related to the Lazarus project, but I know here are many Mac users, so I might get some good responses.

I bit the bullet and bought a new iMac (a marvel of beauty and design). Now I would like to introduce true OS X support in fpGUI Toolkit (instead of going via the Mac X11 backdoor). What API should I use? Carbon or Cocoa? I know Carbon is limited to 32-bit only, but it seems most of the OS X apps are 32-bit anyway, even though the hardware is 64-bit capable. In fact, even the Darwin kernel boots the 32-bit kernel (only the OS X Server boots 64-bit kernel by default). Saying that, it seems even though the kernel is 32-bit by default, OS X still runs 64-bit apps on top of it - some hybrid 32/64-bit mix.

I know the Carbon bindings in FPC are pretty mature, and I have some sample FPC+Carbon code which will help me greatly if I decide to go the fpGUI+Carbon route. How are the Cocoa bindings with FPC?

In summary, what do you Mac developers suggest I use and why? Carbon or Cocoa?

Regards, ? - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net:8080/fpgui/

Reply by email

dmitry boyarintsev
to Graeme Geldenhuys

Hello Graeme,

Cocoa is your choice.
Apple suggests to use Cocoa for all new development and fpGUI for OSX is the one.
Cocoa is supported natively by FPC trunk, so you shouldn't have much troubles using it.

All-in-all both Carbon and Cocoa are using the same low-level framework. In some cases they're using each-other. But, more and more Carbon libraries are being deprecated. As well as all new OS features are available as Cocoa frameworks, instead of C-like (carbon) libraries. There're a lot of Cocoa examples and articles on-line, while you might have hard times finding anything useful about Carbon.

thanks,
dmitry

Reply by email

Felipe Monteiro de Carvalho
to dmitry boyarintsev

Cocoa for sure

On Dec 23, 2010 3:40 PM, "dmitry boyarintsev"
wrote:

Hello Graeme,

Cocoa is your choice.
Apple suggests to use Cocoa for all new development and fpGUI for OSX is the one.
Cocoa is supported natively by FPC trunk, so you shouldn't have much troubles using it.

All-in-all both Carbon and Cocoa are using the same low-level framework. In some cases they're using each-other. But, more and more Carbon libraries are being deprecated. As well as all new OS features are available as Cocoa frameworks, instead of C-like (carbon) libraries. There're a lot of Cocoa examples and articles on-line, while you might have hard times finding anything useful about Carbon.

thanks,
dmitry

Reply by email