Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

main.c

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00013 
00014 #include <Carbon/Carbon.h>
00015 
00016 #include <fish.h>
00017 
00019 //
00022 int main(int argc, char* argv[])
00023 {
00024     IBNibRef        nibRef;
00025     OSStatus        err;
00026     
00027     // Create a Nib reference passing the name of the nib file (without the .nib extension)
00028     // CreateNibReference only searches into the application bundle.
00029     err = CreateNibReference(CFSTR("main"), &nibRef);
00030     require_noerr( err, CantGetNibRef );
00031     
00032     // Once the nib reference is created, set the menu bar. "MainMenu" is the name of the menu bar
00033     // object. This name is set in InterfaceBuilder when the nib is created.
00034     err = SetMenuBarFromNib(nibRef, CFSTR("MenuBar"));
00035     require_noerr( err, CantSetMenuBar );
00036     
00037     // We don't need the nib reference anymore.
00038     DisposeNibReference(nibRef);
00039     
00040     FillFreezer();
00041     printf("Trout weight:\t%d\n", Weigh(fishType_trout));
00042     printf("Carp weight:\t%d\n", Weigh(fishType_carp));
00043     printf("Salmon weight:\t%d\n", Weigh(fishType_salmon));
00044     
00045     // Call the event loop
00046     RunApplicationEventLoop();
00047 
00048 CantGetNibRef:
00049 CantSetMenuBar:
00050     return err;
00051 }
00052 

Generated on Wed Apr 28 17:08:09 2004 for Fish by doxygen 1.3.4