1

I am struggling to find a good tutorial on how a Mac C++ GUI application is structured. Coming from Windows programming I'm used to message loops and window handles... is it comparable on Macs or totally different?

Any links or examples are welcome, particularly those aimed at transitioning from Win32 rather than assuming I'm a noob to programming in general.

update: I should point out this is for a game-like application so I don't need to access common controls; I essentially just need a window to render in and a message loop. I don't know if that's below the Cocoa/Carbon API level or if one or the other still has to be used.

Mr. Boy
  • 60,845
  • 93
  • 320
  • 589
  • When designing applications for OSX, it's worth to have a look at the human interface guidelines: http://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/AppleHIGuidelines/Intro/Intro.html – grefab Sep 23 '11 at 08:35

2 Answers2

1

I once was in the same situation as you. I would suggest checking out the Mac Dev Center and reading their "Getting Started" guide.

clarkb86
  • 673
  • 5
  • 21
  • Out of their hundreds of articles and sample apps I couldn't see one with C++ in the title... maybe you could point me at one?! It seems very OBJ-C oriented. – Mr. Boy Sep 23 '11 at 08:18
  • My fault, I overlooked the fact that you want to used C++. I personally think it would be less of a hassle to just learn Objective-C - it shouldn't take you very long if you know C++. But if that is not your preferred route, I would look into the Qt or wxWidgets cross-platform frameworks for developing GUI applications using C++. – clarkb86 Sep 23 '11 at 08:26
  • As far as I know, the Cocoa APIs only exists in Objective-C... so you will have to give it a try. – gastush Sep 23 '11 at 08:26
  • 1
    @smoldyr: it's a cross-platform C++ app so OBJ-C isn't an option. I actually want to know _how_ toolkits like wx manage this... hence asking what a minimal C++ GUI app would look like for OSX – Mr. Boy Sep 23 '11 at 08:43
  • [Use C++ with Cocoa Instead of Objective-C](http://stackoverflow.com/questions/525609/use-c-with-cocoa-instead-of-objective-c) – clarkb86 Sep 23 '11 at 09:01
0

I had done a development on Mac OS X with C++. I was forced to use Carbon with it. Then we used Qt as solution for C++ development with Mac. But I always had to compromise with bugs already present in Qt Framework. But its worth looking into to get few ideas.

Other than that Objective C++ is also nice. Though you will have to follow Cocoa Design Patterns to come with good application.

RLT
  • 4,219
  • 4
  • 37
  • 91