Page 1 of 1

Learning Carbon -Need Help

Posted: Tue Aug 15, 2006 3:19 pm
by Nik
Awaiting Purebasic for Intel Macs, I have started learning some carbon using Xcode and C++. I use nib files to create the Window but I can't seem to get a handle to the Controls in there, I use GetControlByID but it always returns 0 can anyone please help me to find my mistake?
Here is my small example:
http://www.sceneproject.org/~niklas/carbontest2.zip


//The Code should run on both PPC and Intel

Posted: Wed Aug 16, 2006 4:30 pm
by Nik
Ok the Problem is GetControlByID butthe problem is that SteControlTitleWithCFString() doesn't set the visible text of the control but som hidden property reading it out in turn works as expected, so now I need to find the function that sets the visibe Text of an EditText Control

Posted: Wed Aug 16, 2006 7:45 pm
by Nik
Ok I solved the problem and managed to finish my example, you can download it here:
http://sceneproject.org/~niklas/carbontest2.zip

Nice one Nik

Posted: Thu Aug 31, 2006 12:59 am
by johnfinch
I've been thinking of doing this myself while I wait for PB to be updated. Have you a good book that you recommend for learning Carbon and C++ on OSX? I don't like Objective-C nearly as much as C++.

Posted: Wed Sep 06, 2006 6:39 pm
by Nik
I'm trying the Learning by Doing way since my mac was expensive and I don't want to spend even more money... seems good so far. Look at my example for a start then you can ask questions.
btw: There is a small mistake in the example: one string doesn't get freed so there is a small memory leak I have fixed it here and I will probably upload a fixed version.

Re: Nice one Nik

Posted: Wed Sep 06, 2006 7:28 pm
by jroad
johnfinch wrote:I've been thinking of doing this myself while I wait for PB to be updated. Have you a good book that you recommend for learning Carbon and C++ on OSX? I don't like Objective-C nearly as much as C++.
You can find some recommendations and resources at the MacRumors Programming forum:
http://forums.macrumors.com/showthread.php?t=90331

Posted: Fri Oct 20, 2006 3:27 pm
by johnfinch
I have been reading this book. It's rather good and will keep me entertained until the new PB4 MAC is realeased.

Mac OS X Programming by Dan Sydow

The book is all about programming in Carbon using C. It's a blast.

I'm really looking forward to PB4 for my Intel Mac though. It's just so much easier and more intuitive. Makes you wonder how C took over from Basic all those years ago. I remember using QuickBasic from MS for years and writing some excellent applications with it. But hey, we are fighting back again now. I look forward to all the OSX applications that will hit the streets when we have PB working :)