I actually tried to build a carbon program today. It's been an experience. I'm a little unwilling to go down the objectionableC/cocoa route, since, well, I'm a C programmer at heart. But nearly all the carbon documentation assumes you'll be using the GUI Interface Builder and nib files. I don't want to do that (at least not yet), so it's an uphil struggle. Has really no-one done this? And I like emacs, so have inbuilt reluctance to go with Xcode, too.
When I learned gtk+, there were a few tutorials to follow, and that was enough to get me going.
Anyway, I managed the following short piece of code:
#include <Dialogs.h>
int main(void)
{
DialogRef theItem;
DialogItemIndex itemIndex;
CreateStandardAlert(kAlertStopAlert,
CFSTR("Here be titles..."),
CFSTR("Hello, world!"),
NULL,
&theItem);
RunStandardAlert (theItem, NULL, &itemIndex);
}
And managed to get it to build with:
gcc test.c -framework carbon -I /Developer/Headers/FlatCarbon -o test
...not much for a lot of work, is it? The button doesn't even work...
There are 7 comments on this entry.