[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gm2 Digest, Vol 157, Issue 6
From: |
Gaius Mulley |
Subject: |
Re: gm2 Digest, Vol 157, Issue 6 |
Date: |
Mon, 06 Jan 2020 12:42:43 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Johannes Slotboom <address@hidden> writes:
> Dear Gaius
>
> I have to apologize for my lots of mails.
> As you indicated in your first mail I should consider the example you
> sent as a link on the use of ncurses.
> The clear(), works on a window (object I guess). The code that works
> now (also leaving the bash-shell in a well behaved state after program
> termination is the following.
>
> MODULE clear_screen_m2;
>
> FROM ncurses IMPORT
> clear,beep,WINDOW,initscr,isendwin,endwin,wclear,wrefresh;
> FROM InOut IMPORT WriteString, WriteLn, Read;
> FROM M2RTS IMPORT InstallTerminationProcedure ;
>
> VAR retVal:INTEGER;
> w : WINDOW ;
> chr: CHAR;
>
> PROCEDURE ResetScreen ;
> VAR
> r: INTEGER ;
> BEGIN
> IF NOT isendwin()
> THEN
> r := endwin()
> END
> END ResetScreen;
>
> BEGIN
> w := initscr() ;
> retVal := clear ();
> retVal := wclear(w) ;
> retVal := wrefresh(w) ;
> WriteLn;
> WriteString(" After first clear screen ");WriteLn;
> Read( chr );
> retVal := beep ();
> retVal := clear ();
> retVal := wclear(w) ;
> retVal := wrefresh(w) ;
> (* retVal := clear (); *)
> WriteString(" After second clear screen ");WriteLn;
> Read( chr );
> retVal := beep ();
> retVal := clear ();
> retVal := wclear(w) ;
> retVal := wrefresh(w) ;
> WriteString(" After third clear screen ");WriteLn;
> Read( chr );
>
> retVal := beep ();
> retVal := clear ();
> retVal := wclear(w) ;
> retVal := wrefresh(w);
> IF NOT InstallTerminationProcedure(ResetScreen)
> THEN
> HALT
> END
>
> END clear_screen_m2.
>
> I used the following build command:
>
> gm2 -g -I. -
> I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/pim
> -I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/log
> -I/home/slotboom/opt/lib/gcc/x86_64-pc-linux-gnu/8.2.0/m2/min -L.
> -l:libncurses.so.5 -flibs=pim,log -fmakeall ./clear_screen_m2.mod*
>
> and the libncurses.so.5 was located in the same directory as the
> program.
> I apologize again for my large amount of mails.
>
> Have a nice day,
>
> Hans
Hi Hans,
no problem at all - it is what the mailing list is for and it will help
others in the future. Well done getting it all working,