bug-ncurses
[Top][All Lists]
Advanced

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

RE: Setting last character on screen (without scrolling enabled)


From: Michael Bohn
Subject: RE: Setting last character on screen (without scrolling enabled)
Date: Fri, 8 Jun 2012 08:34:54 +0000

Ok I will try these workarounds.

I'm using NCurses from Haskell with the hscurses library 
(http://hackage.haskell.org/package/hscurses).
Any you are right, the library does not provide all functions from NCurses, but 
they can be easily integrated
with the Haskell FFI.

Regards,
Michael
________________________________________
From: Thomas Dickey address@hidden
Sent: 08 June 2012 00:30
To: Michael Bohn
Cc: address@hidden
Subject: Re: Setting last character on screen (without scrolling enabled)

On Thu, Jun 07, 2012 at 10:04:53AM +0000, Michael Bohn wrote:
> Is there a workaround for this?  Is it possible to set a character at a
> position without moving the cursor or something like waddstr that moves the
> cursor to the left?

As a quick workaround, you can put a character (8-bits) into a chtype
and use addchstr (which does not move the cursor).  The wide-character
form add_wchstr requires setup of the data using setcchar.

Alternatively, you can use addch to write to the next-to-last cell the
character that you want to use in the last cell, then insert a character
into the next-to-last cell, e.g., with insch

It sounds as if you are not programming in C, but using something that
has a binding - the binding may be incomplete (I'm curious).

> Regards,
> Michael
> ________________________________________
> From: Thomas Dickey address@hidden
> Sent: 07 June 2012 02:24
> To: Michael Bohn
> Cc: address@hidden
> Subject: Re: Setting last character on screen (without scrolling enabled)
>
> On Wed, Jun 06, 2012 at 11:02:55AM +0000, Michael Bohn wrote:
> > Assume you have a NCurses Window (could be a subwindow) with dimensions ROWS
> > and COLS.  How do I set the character at ROWS-1 and COLS-1.  If I use 
> > waddstr
> > at this position with one character it doesn't work (throws a user
> > exception).  I assume this is because the cursor is moved to a position
> > outside the window?
>
> either waddstr or waddch will write the character (and it will be displayed),
> but return an error because the wrap to the next line fails.
>
> Solaris curses works like this; some programs rely on the behavior.
>
> --
> Thomas E. Dickey <address@hidden>
> http://invisible-island.net
> ftp://invisible-island.net

--
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net



reply via email to

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