Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

c++ interface book

4 views
Skip to first unread message

imu...@hotmail.co.uk

unread,
Sep 27, 2006, 6:33:02 AM9/27/06
to
Hi,
I am looking for a book to help me with creating user interfaces and
some graphical output for C++ programs. I saw some books on cocoa but
some of them are several years old now and seem to be about Objective C
rather than C++, not that it matters how the interface connects with
the rest of a program.
Thanks.

David Phillip Oster

unread,
Sep 27, 2006, 9:33:21 AM9/27/06
to
In article <1159353182....@b28g2000cwb.googlegroups.com>,
imu...@hotmail.co.uk wrote:


If you are new to writing Macintosh applications, I strongly recommend
you learn Cocoa, the Objective-C U.I. framework, and use it for your
user interface.

My recommendation: Read "Cocoa Programming for Mac OS X" by Hillegas. Do
the exercises in the book.

In your programs, name your ".m" files with a ".mm" extension. The
compiler recognizes .mm as containing both Objective-C and C++.
Objective-C objects can hold pointers to C++ objects.

C++ objects can hold pointers to Objective-C objects, but if the C++
object is copyable and retains the obj-c object, with a release in the
C++ objects' destructor, you'll either want to also retain in you copy
constructor and assignment operator, or refer to the obj-C object
through a boost::shared_ptr (or a tr1::shared_ptr).

C++ and Objective-C don't understand each other's exceptions, so you'll
need to be liberal with your try{}catch(){} and @try{}@catch(){} at the
boundaries, where functions in one language call functions in the other.

For drawing, Quartz drawing is rather like Postscript, and the system
takes care of translation to postscript when you print. You may also
create OpenGL panes from Cocoa, and draw in OpenGL into those panes from
C++. OpenGL is a C api found on both Macs and windows.

0 new messages