home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 August: Tool Chest / Apple_Developer_Group_August_1996_Tool_Chest.iso / Sample Code / Snippets / Toolbox / Splasher / Template.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-24  |  992 b   |  50 lines  |  [TEXT/KAHL]

  1. /**------------------------------------------------------------------------------------- 
  2.  
  3.    Simple demonstration of a modal splash screen window
  4.  
  5.  **-----------------------------------------------------------------------------------**/
  6.  
  7.  
  8.  
  9. /*------ main ----------------------------------------------------------------------------*/
  10.  
  11. main()
  12.  
  13. {
  14.  
  15. GrafPort myPort;
  16. WindowPtr myWindow;
  17. EventRecord myEvent;
  18. Boolean doQuit;
  19.  
  20.  
  21.     InitGraf((Ptr) &thePort);
  22.     OpenPort(&myPort);
  23.     InitFonts();
  24.     InitWindows();
  25.     InitMenus();
  26.     TEInit();
  27.     InitDialogs(nil);
  28.     InitCursor();
  29.     
  30.     doQuit = false;
  31.     myWindow = GetNewWindow(128, NULL, (WindowPtr)-1L);
  32.     SetPort(myWindow);
  33.     MoveTo(15,15);
  34.     DrawString("\pThis is our splash screen test of the mouse...");
  35.     while (doQuit == false) {
  36.         if(WaitNextEvent(everyEvent, &myEvent, 10L, NULL)) {
  37.             switch (myEvent.what) {
  38.             case mouseDown:
  39.             case autoKey:
  40.             case keyDown: {
  41.                 DisposeWindow(myWindow);
  42.                 doQuit = true;
  43.                 break;
  44.                 }
  45.             };
  46.         }
  47.     }
  48.     ExitToShell();
  49. }
  50.