bug-ncurses
[Top][All Lists]
Advanced

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

Re: print array of characters & attributes?


From: Folkert van Heusden
Subject: Re: print array of characters & attributes?
Date: Sun, 18 Feb 2007 03:09:53 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

> >>>Could not find so: does ncurses has a function which has as input some
> >>>kind of array of characters to display and for each character also its
> >>>attributes?
> >>perhaps waddchnstr()
> >Ok it seems waddchnstr(win, &bla, 1); is faster (60%) then waddch(win,
> >'.') so I think building a string into a buffer of chtype and then
> >putting it on the display with waddchnstr might help.
> >Can I just do:
> >     chtype var = 'a';
> >to set a character
> >     var |= A_REVERSE
> >to set an attribute type
> >     var |= COLOR_PAIR(1)
> >to set a color?
> yes - for the chtype interface.
> That doesn't apply to the cchar_t interface (I mentioned both in my 
> reply).

Yes - works like a charm!

One problem though: how to advance the cursor.
If I let the cursor stay at the x=0 and then do a waddch(win, '\n'), the
line gets cleared before the cursor moves to the next line.
If the line displayed is smaller than the width of the terminal, I can
simple place the cursor behind it and then do the waddch. But if the
line is the width of the terminal, I cannot place the cursor behind it.
Just putting it at the last column of the terminal doesn't work either
as it'll clear the last character.
getyx(win, y, x); wmove(win, y + 1, 0); won't work as it might need
scrolling.
Is there any way around this?


Folkert van Heusden

-- 
www.vanheusden.com/multitail - multitail is tail on steroids. multiple
               windows, filtering, coloring, anything you can think of
----------------------------------------------------------------------
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com




reply via email to

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