home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 337_01 / panel1.c < prev    next >
C/C++ Source or Header  |  1991-01-14  |  1KB  |  43 lines

  1. /* Copyright (c) James L. Pinson 1990,1991  */
  2.  
  3. /**********************   PANEL1.C   ***************************/
  4.  
  5. /* demonstrate the creation of three window panels */
  6.  
  7. #include "mydef.h"   /* always include this */
  8. #include <stddef.h>  /* we need the definition of NULL from here */
  9.  
  10.  
  11. int start(void)
  12. {
  13. extern struct screen_structure scr;
  14. extern struct window_structure w[];
  15.  
  16. int top, middle,bottom;
  17.  
  18.  cls();           /* clear initial window */
  19.  
  20.  alt_screen(ON);  /* let's draw the windows off screen */
  21.  
  22.  /* calculate the window sizes to fit true column and row */
  23.  /* don't assume 80x25 */
  24.  
  25.  top=win_make(2,2,scr.columns-2,1,TOP_FRAME,"",scr.normal,
  26.               scr.normal);
  27.  print(1,1,"test panel 1");
  28.  
  29. middle=win_make(2,4,scr.columns-2,scr.rows-6,MIDDLE_FRAME,"",
  30.                 scr.normal,scr.normal);
  31. print(1,1,"test panel 2");
  32.  
  33. bottom=win_make(2,scr.rows-1,scr.columns-2,1,BOTTOM_FRAME,"",
  34.                 scr.normal,scr.normal);
  35. print(1,1,"test panel 3");
  36.  
  37. win_pop_top(middle);  /* make middle window topmost */
  38.  
  39. alt_screen(OFF); /* show the finished screen */
  40.  
  41. return (0);
  42. }
  43.