emperor: (Default)
posted by [personal profile] emperor at 04:17pm on 17/03/2005

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...
Mood:: 'disappointed' disappointed

Reply

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

October

SunMonTueWedThuFriSat
      1
 
2
 
3
 
4
 
5
 
6
 
7
 
8
 
9
 
10
 
11
 
12
 
13
 
14
 
15
 
16
 
17
 
18
 
19
 
20
 
21
 
22
 
23
 
24
 
25
26
 
27
 
28
 
29
 
30
 
31