home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume4 / xgen / part03 / main.c < prev    next >
C/C++ Source or Header  |  1989-06-29  |  1KB  |  73 lines

  1. #include <stdio.h>
  2. #include <X11/Intrinsic.h>
  3. #include <X11/Shell.h>
  4. #include  "application.h"
  5.  
  6. Widget top_level;
  7.  
  8. extern void get_env();
  9. extern void help();
  10.  
  11. XtTranslations input_text_translations;
  12.  
  13.  
  14.  
  15. main(argc, argv)
  16. int argc;
  17. char **argv;
  18.  
  19. {
  20.     static XtActionsRec actionlist[] =
  21.     {
  22.         {"Help", help},
  23.     };
  24.  
  25.     struct shell *help_board;
  26.     struct shell *error_board;
  27.     struct shell   *get_shell();
  28.     XtTranslations parse_spreadsheet_transl();
  29.  
  30.  
  31.     /* Initialize the Toolkit and the resource manager */
  32.     top_level = XtInitialize("", "", NULL ,NULL, &argc, argv);
  33.  
  34.  
  35.     XtAddActions( actionlist, 1);
  36.  
  37.  
  38.     /*parse translations at initialization time */
  39.     input_text_translations = parse_spreadsheet_transl();
  40.  
  41.     /*parse application script*/
  42.     parse_app( argv[1] );
  43.  
  44.     /*create help shell*/
  45.  
  46.     help_board = get_shell("help");
  47.  
  48.     if( help_board == NULL )
  49.     {
  50.         fprintf(stderr, " Error: description of msgboard \"help\" is not provided\n");
  51.         exit(-1);
  52.     }
  53.     create_msgboard(help_board);
  54.  
  55.     error_board = get_shell("error");
  56.  
  57.     if( error_board == NULL )
  58.     {
  59.         fprintf(stderr, " Error: description of msgboard \"error\" is not provided\n");
  60.         exit(-1);
  61.     }
  62.     create_msgboard(error_board);
  63.  
  64.  
  65.     /*bring to the screen the environment called top level */
  66.     get_env( top_level, "top level" );
  67.  
  68.     XtMainLoop();
  69.  
  70. }
  71.  
  72.  
  73.