slang-users mailing list

[2001 Date Index] [2001 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: screen wrap


Konstantin Boldyshev <konst@xxxxxxxxxxxxxxxxx> wrote:
>I have trouble with SLsmg_write_char() function.
[...]
>call SLsmg_refresh(). But when number of characters
>exceeds terminal width, slang somewhy just cuts this
>number to terminal width, instead of writing whole
>character sequence (which will then simply go nextline).

The SLsmg routines do not implement automatic automatic margins.
It provides other routines to achieve this effect, e.g.,
SLsmg_write_wrapped_string.  

Another possibility would be to do the following:

   void write_char_with_wrapping (char ch)
   {
      if ((ch != '\n')
          && (SLsmg_get_col () >= SLtt_Screen_Cols))
	SLsmg_write_char ('\n');
      SLsmg_write_char (ch);
   }

and use it in place of SLsmg_write_char.  This also assumes that you
have added

   SLsmg_Newline_Behavior = SLSMG_NEWLINE_SCROLLS;

after you called SLsmg_init_smg.

--John


[2001 date index] [2001 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]