[Coco] OS9 Save and Restore Window
tim lindner
tlindner at ix.netcom.com
Wed Jan 4 00:41:28 EST 2006
On RTSI there is a library call Window_SaveRestore_fncs.lzh. It allows
recording all of the characteristics of a Windint window. This is nice
to be able to save a window, change it and then change it back. But I
found a problem that I don't fully understand.
Here is the program:
/* status.c - testing cgfx status functions */
#include <stdio.h>
#include <sgstat.h>
#include <window.h>
#include <buffs.h>
#define STDIN 0
#define STDOUT 1
#define BLACK 2
main()
{
WINDOW *w;
w = getwind(STDOUT);
DWEnd(STDOUT);
DWSet(STDOUT,8,0,0,40,24,0,1,2);
system( "merge /dd/sys/stdfonts" );
Font(STDOUT,GRP_FONT,FNT_S8X8);
Select(STDOUT);
CurOff(STDOUT);
BColor(STDOUT,0);
FColor(STDOUT,1);
Clear(STDOUT);
CurXY(STDOUT,6,10);
write(STDOUT,"This is now a Type 8 window!",28);
tsleep(300);
Clear(STDOUT);
CurXY(STDOUT,8,9);
write(STDOUT,"I will now reset back to",24);
CurXY(STDOUT,8,11);
write(STDOUT,"original characteristics",24);
tsleep(180);
if(w != NULL)
setwind(STDOUT,w);
Select(STDOUT);
}
The library and the above program work well when run from the command
line. But when you run the program with the standard input redirected
from a file, it doesn't. The screen goes blank, and the returns to
normal after the program finishes.
This means I can't run the program from a shell script. I've tried the
program with the newest NitrOS-9 and also stock OS-9. Both exhibit the
same behaivor.
I would like to find the root cause of what I am seeing. But I need to
ask, Is there something in OS-9 that would keep this from working? Or
have I found a bug?
--
tim lindner
tlindner at ix.netcom.com Bright
More information about the Coco
mailing list