home *** CD-ROM | disk | FTP | other *** search
- /*
- demofsav.c
-
- jmd 6/89
-
- Copyright (c) 1989, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- This program demonstrates saving a sed to a screen file.
-
- It saves the sed to the screen file "test.lnf"
- with the screen name "test"
-
- You can use the example program DEMOFLOD to load the screen.
- */
-
- #include <stdio.h>
- #include <cscape.h>
- #include <sfile.h>
-
- /* function symbol table */
-
- fsyminit_struct my_list[] = {
-
- {FSYM_CLASS},
- {"sedwin_Class", (VOID_FPTR) sedwin_Class , NULL },
-
- {FSYM_FIELDFUNCS },
- {"string_funcs", FNULL, (VOID *) &string_funcs},
-
- {FSYM_USER },
-
- {FSYM_BORDER },
- {"bd_box", (VOID_FPTR) bd_box, NULL},
-
- {FSYM_MOUSE },
- {FSYM_MOVEMETHOD },
- {FSYM_EXPLODE },
- {FSYM_SPECIAL },
- {FSYM_AUX },
- {FSYM_LISTEND}
- };
-
- void main()
- {
- menu_type menu;
- sed_type sed;
- sfile_type sfile;
- char name[22];
-
- name[0] = '\0';
-
- /* Initialize the display */
- disp_Init(def_ModeText, NULL);
-
- /* Open the sfile */
- sfile = sfile_Open("test.lnf", my_list);
-
- /* Create the sed */
- menu = menu_Open();
-
- menu_Printf(menu, "This is a test\n");
- menu_Printf(menu, "@f[#########]\n", name, &string_funcs);
- menu_Printf(menu, "@a[0x24]All done\n");
- menu_Printf(menu, "@a[0x31]All done");
-
- sed = sed_Open(menu);
- sed_SetBorder(sed, bd_box);
- sed_SetBorderTitle(sed, "Test");
- sed_SetPosition(sed, 5, 10);
-
- /* Put the sed into the sfile */
- sfile_SaveSed(sfile, sed, "test");
-
- sed_Repaint(sed);
- sed_Go(sed);
- sed_Close(sed);
-
- sfile_Close(sfile);
- disp_Close();
- }
-