[Coco] OS9 Save and Restore Window

Bob Devries devries.bob at gmail.com
Wed Jan 4 05:59:41 EST 2006


Tim,
I suspect that the problem is that when you're running a script, the STDIN 
and STDOUT are not attached to the windowing system at all, but point to the 
script. I don't know how to veryify this, though. I think if you use the 
"procs" command (or the modified version called "proc" you will see where 
the standard I/O paths are.
--
Regards, Bob Devries, Dalby, Queensland, Australia

Isaiah 50:4 The sovereign Lord has given me
the capacity to be his spokesman,
so that I know how to help the weary.

website: http://www.home.gil.com.au/~bdevasl
my blog: http://bdevries.invigorated.org/

----- Original Message ----- 
From: "tim lindner" <tlindner at ix.netcom.com>
To: "CoCo Mailing List" <coco at maltedmedia.com>
Sent: Wednesday, January 04, 2006 3:41 PM
Subject: [Coco] OS9 Save and Restore Window


> 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
>
> -- 
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco 




More information about the Coco mailing list