Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Supershane457

macrumors newbie
Original poster
Aug 5, 2010
6
0
Hi. I've been using C++ for awhile. And I just got a new Mac. I know Xcode is very nice but I still prefer C++ to Cocoa and Carbon. So I was wondering are there any good C++ GUIs for a mac?
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
Cocoa and Carbon are libraries, not languages so your question is a bit nonsensical: you can access Cocoa via Objective-C++ from C++ and/or Carbon from C++ (as Carbon is pure procedural C). If you want a pure C++ library you will have to look at non-Apple GUI toolkits which will result in apps that do not feel 100% platform native.
 

Supershane457

macrumors newbie
Original poster
Aug 5, 2010
6
0
Sorry I meant the Objective-C language. Xcode is foreign to me with all the different libraries and files. But do you know if Qt would be good? I'm looking into that now.
 

Supershane457

macrumors newbie
Original poster
Aug 5, 2010
6
0
Thank you. I don't really mind. I was only looking for a cross platform GUI. But if you knew of any way to integrate C++ into an Xcode Project that would also be nice.:)
 

mfram

Contributor
Jan 23, 2010
1,307
343
San Diego, CA USA
Create a new Objective-C++ project and you should be good to go. Use the Objective-C Mac libraries to do the UI stuff and have that code call your existing C++ code. It will all integrate together. I haven't personally done this, but I see the options to create Objective-C++ projects in XCode.
 

ShortCutMan

macrumors member
Aug 8, 2005
41
0
Qt should be fine, and is quite easy to get into. I use it at work, however, that is developing for the Windows platform; I haven't used it for OS X. But don't be discourage by Cocoa and its use of Objective-C! Take up the challenge and learn it, I'm sure you'll be pleasantly surprised! :)
 

pinsrw

macrumors regular
May 30, 2010
194
0
The major options are all not very good: Qt, GTK+ and WxWidgets, I have found, are all buggy due to their being huge projects with months-long backlogs of bug reports that no one is paid for fix. Very few programmers who do widget sets have stuck to the maxim of small, modular coding projects; almost everything is bloated junk.
 

cube

Suspended
May 10, 2004
17,011
4,972
What are you talking about? Trolltech developed Qt and it is now owned by Nokia.

Of course there are people paid to work on it. And it works well.
 

elppa

macrumors 68040
Nov 26, 2003
3,233
151
You can still write all the logic, non GUI code in C++.

But if you get to grips with how outlets and bindings work then if it is a small app it may not be that much work to get a far better result out the other end on the Mac.

Maybe I'm being unkind, but I think it might be time to bite the bullet and try something new. Cross platform GUIs are always a not very good compromise.
 

larkost

macrumors 6502a
Oct 13, 2007
534
1
elppa's suggestion is really the right one. If you intend to write applications on MacOS X that are even close to feeling like MacOS X applications then you need to code the GUI's with the AppKit (Cocoa) Framework. Anything else is going to feel alien, and MacOS X users are sensitive to that[1].

You can still build all of of your logic in C++, but you need to have clean separation of your program logic and the presentation system. If you are doing it right you already have this, and this division should be easy.

My interpretation of Supershane457's objections boil down to his/her being used to one way of doing things (some C++ library) and reacting negatively to a new way doing things (AppKit/Cocoa). If you are going to work on MacOS X, then you are going to have to get used to the way of doing things here. Swimming up-stream is not going to be very productive.

[1] They are not the only ones, look at the gnashing of teeth on Windows over iTunes and QuickTime which feel non-native there.
 
Aug 26, 2008
1,339
1
elppa's suggestion is really the right one. If you intend to write applications on MacOS X that are even close to feeling like MacOS X applications then you need to code the GUI's with the AppKit (Cocoa) Framework. Anything else is going to feel alien, and MacOS X users are sensitive to that[1].

You can still build all of of your logic in C++, but you need to have clean separation of your program logic and the presentation system. If you are doing it right you already have this, and this division should be easy.

My interpretation of Supershane457's objections boil down to his/her being used to one way of doing things (some C++ library) and reacting negatively to a new way doing things (AppKit/Cocoa). If you are going to work on MacOS X, then you are going to have to get used to the way of doing things here. Swimming up-stream is not going to be very productive.

[1] They are not the only ones, look at the gnashing of teeth on Windows over iTunes and QuickTime which feel non-native there.

I think it's more to do with the fact that the programs are absolutely terrible on Windows, not how they look. Plenty of different looking things on Windows, and the users generally deal.
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
It's unfortunate that Apple has given up on Carbon. From a few recent explorations into Carbon it appears that most of the procedural APIs are actually implemented in C++ privately (e.g. HIObjectRef, HIView, etc). Would have been nice if they supported that layer officially.

Semi-OT: to those who are doing cross-platform UIs on Mac and Windows, what do you use for Windows? MFC?
 

pinsrw

macrumors regular
May 30, 2010
194
0
Of course there are people paid to work on (Qt). And it works well.

I tried their OpenGL Hello world program, and guess what happened? The OpenGL subwindow, which was supposed to be confined with the area of its widget, instead appeared outside of the main window. I ran the code a few times and it appeared a different spot on the display every time. I've got no time to wait for Nokia to fix such basic bugs.
 

Supershane457

macrumors newbie
Original poster
Aug 5, 2010
6
0
Sorry I couldn't reply for several days. I've been a little busy. But thank you for all of your suggestions. I decided to take on the challenge of learning objective-c and I'm still very new to it but it works well :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.