int main (int argc, char* argv[])
{
IBNibRef nibRef;
WindowRef window;
// Create a nib reference to a nib file.
CreateNibReference (CFSTR ("main"), &nibRef);
SetMenuBarFromNib (nibRef, CFSTR("MenuBar"));
CreateWindowFromNib (nibRef, CFSTR("MainWindow"), &window);
// Dispose of the nib reference as soon as you don’t need it any more.
DisposeNibReference (nibRef);
// Make the unarchived window visible.
ShowWindow (window);
// Start the event loop. RunApplicationEventLoop is a
// Carbon Event Manager function.
RunApplicationEventLoop ();
return 0;
}
int main (int argc, char* argv[])
{
IBNibRef nibRef;
CreateNibReference (CFSTR ("main"), &nibRef);
SetMenuBarFromNib (nibRef, CFSTR("MenuBar"));
DisposeNibReference (nibRef);
RunApplicationEventLoop ();
return 0;
}
int main (int argc, char* argv[])
{
RunApplicationEventLoop ();
return 0;
}
Build and Go:
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (0)