home *** CD-ROM | disk | FTP | other *** search
- #include <scl1.h>
- #include <scl1clor.h>
-
- /* TextWindow example */
-
- char *strings[]={
- "These strings will be written",
- "to a Text Window, one by one.",
- "Text will scroll in TTY mode",
- "So as to simulate a",
- "DOS like screen.",
- "Several control characters",
- "like\t\ttab (\\t),",
- "new line (\\n)\rand carriage return (\\r)",
- "are supported."};
-
- main()
- {
- TWData twd;
- int i,Mess;
-
- Cls(WHITE_BLACK,CLS_ALL);
- TextWindow(TW_INIT,&twd); /* initialize structure */
- twd.UpperRow=10; /* modify position */
- twd.LowerRow=15;
- twd.LeftCol=20;
- twd.RightCol=60;
-
- /* in this example we'll check for the WINDOW_FULL message and
- wait for a key to be pressed before writing anything else */
-
- TextWindow(TW_DRAW,&twd); /* draw */
- for(i=0;i < 9;++i)
- {
- Mess=TextWindow(TW_WRITE,&twd,strings[i]);
- if(Mess==TW_WINDOW_FULL) /* window full? */
- {
- WriteScreen(WHITE_BLACK+HIGHLIGHT,16,21,"Press any key for more...");
- GetKey();
- TextWindow(TW_CLS,&twd);
- }
- }
-
- WaitTime(100);
-
- /* now, we'll get the same effect using the WAIT_ON message, TextWindow
- will now stop and wait for a key when the window is full */
-
- TextWindow(TW_DRAW,&twd);
- TextWindow(TW_WAIT_ON,&twd);
- for(i=0;i < 9;++i)
- TextWindow(TW_WRITE,&twd,strings[i]);
- }