home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Utility Spectacular / Text / Digest-Browser-1.6 Folder / Application / BrowserMain.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-09-06  |  1.3 KB  |  60 lines  |  [TEXT/KAHL]

  1. /******************************************************************************
  2.  
  3.   BrowserMain.c
  4.  
  5.      The main file for the Digest Browswer.  It displays a splash
  6.      screen, initialiazes variables, and gets TCL running.
  7.  
  8.   Copyright © 1991 Manuel A. Pérez.  All rights reserved.
  9.   
  10. ******************************************************************************/
  11.  
  12.  
  13. #include "CBrowserApp.h"
  14.  
  15. // Prototypes
  16. void InitToolbox(void);
  17.  
  18.  
  19. void main()
  20. {
  21. DialogPtr theDialog;
  22. CBrowserApp    *BrowserApp;                    
  23. long dlogDisplay;
  24.  
  25.     // initialize the toolbox
  26.     InitToolbox();
  27.  
  28.     dlogDisplay = TickCount();
  29.     theDialog = GetNewDialog(1000, NULL, (WindowPtr)-1);
  30.     if (theDialog)
  31.         DrawDialog(theDialog);                // make sure is drawn
  32.  
  33.     // Create a new application object, and set everything up
  34.     BrowserApp = new CBrowserApp;
  35.     BrowserApp->IBrowserApp();
  36.  
  37.     // leave the dialog up for 2 seconds
  38.     if (theDialog) {
  39.         while (TickCount() - dlogDisplay < (2 * 60));
  40.         DisposeDialog(theDialog);
  41.     }
  42.  
  43.     // ... and go
  44.     BrowserApp->Run();
  45.     BrowserApp->Exit();
  46. }
  47.  
  48. // InitToolbox, this is the InitToolbox from TCL. I moved it
  49. // out here so that we can display the splash screen.
  50. void InitToolbox(void)
  51. {
  52.     InitGraf(&thePort);                    // Standard initialization calls
  53.     InitFonts();
  54.     InitWindows();
  55.     InitMenus();
  56.     TEInit();
  57.     InitDialogs(NULL);                    // Add a ResumeProc
  58.     InitCursor();
  59. }
  60.