Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Creating C++ GUI Applications

Creating C++ GUI Applications
Thread Tools
Fresh-Faced Recruit
Join Date: Aug 2006
Location: London, UK
Status: Offline
Reply With Quote
Aug 23, 2006, 03:28 PM
 
Hi,

I'm learning C++, and I've had some experiance on a Windows machine before. I'm interested in creating a GUI application (not a console, so something with buttons, menu bars etc..) but I was wondering how I could do it. With Windows you can use the Win32 API, and I was wondering what the equivilent was for Mac. Can it be done with C++ on OS X. I'm using Xcode on 10.4.7. When I start a new program, I select C++ Tool from Command Line Utility. Is this what I should be doing if I want to create a GUI app with C++?

Thank you very much for any suggestions!
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Aug 23, 2006, 04:34 PM
 
Try making a Carbon Application (which uses the Carbon API). The "* Tool" project styles refer to command-line programs.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Fresh-Faced Recruit
Join Date: Aug 2006
Location: London, UK
Status: Offline
Reply With Quote
Aug 23, 2006, 04:42 PM
 
I'm not so sure what Carbon is. Is it written in the C++ Language or not? Thanks for the quick reply!
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Aug 23, 2006, 04:49 PM
 
Carbon is an API for graphical applications. It's written in C, but it's perfectly compatible with C++. Apple has documentation on its developer site.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Fresh-Faced Recruit
Join Date: May 2003
Status: Offline
Reply With Quote
Aug 24, 2006, 12:35 PM
 
carbon is equivalent to the win32 API. neither are C++, you would have to wrap both in C++ classes. didn't code warrior have a C++ API?
I am now going to tell the computer what he can do with a life-times supply of chocolate.
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Aug 25, 2006, 06:58 PM
 
Originally Posted by KEL9000
carbon is equivalent to the win32 API. neither are C++, you would have to wrap both in C++ classes. didn't code warrior have a C++ API?
Yeah, it did. It was called PowerPlant, and it's old and crufty.

If you want to create GUI applications on OS X, you almost certainly want to use Cocoa. Even if you're creating a modern Carbon application on OS X, you'll have to use some Cocoa for things like Core Image.

Learn Objective-C. Learn Cocoa.
     
Senior User
Join Date: Feb 2003
Location: USA
Status: Offline
Reply With Quote
Aug 26, 2006, 03:11 PM
 
I agree with Angus_D IF you really want to create OS X GUI applications. Having said that, if you are really interested in C++, perhaps for educational purposes or maybe wanting to write Windows apps one day, you can intermix C++ with Objective-C.

The Objective-C Programming Language: Using C++ With Objective-C

But then you're learning two languages at the same time, which may confuse you.

What are your ultimate goals in programming?
MacBook 2.0 160/2GB/SuperDrive
Lots of older Macs
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Aug 26, 2006, 03:33 PM
 
I reckon Carbon is most similar to the Win32 API, which is what he wanted, though I agree Cocoa is generally better.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 10:58 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2