gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gm2 Digest, Vol 157, Issue 6


From: Johannes Slotboom
Subject: Re: gm2 Digest, Vol 157, Issue 6
Date: Mon, 6 Jan 2020 13:54:50 +0100

Thank you for your support!

On Mon, Jan 6, 2020 at 1:42 PM Gaius Mulley <address@hidden> wrote:
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,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]