curses: saving and restoring window chars/colours
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > curses: saving and restoring window chars/colours




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    curses: saving and restoring window chars/colours  
Simon Elliott


Report This Message To A Moderator Edit/Delete Message


 
11-22-05 12:50 PM

I'm using curses and opening a new window with newwin() and closing it
with delwin(). The only trouble is, when I call delwin(), the window's
contents are still displayed on the screen.

Is there any way of saving what would be under the new window, and
restoring it after the new window is closed? The new window is always
opened on top of the main stdscr window.

I see in the man pages that there's a scr_dump() and scr_restore()
which might do what I want. but these expect to use files, and I'd like
to store the screen state in memory instead.

--
Simon Elliott    http://www.ctsn.co.uk





[ Post a follow-up to this message ]



    Re: curses: saving and restoring window chars/colours  
Thomas Dickey


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-22-05 12:50 PM

Simon Elliott <Simon at ctsn.co.uk> wrote:
> I'm using curses and opening a new window with newwin() and closing it
> with delwin(). The only trouble is, when I call delwin(), the window's
> contents are still displayed on the screen.

For this case, you would touch the window that you want to redisplay.
The panel library does this in general, but touchwin/wrefresh work
for special cases.

> Is there any way of saving what would be under the new window, and
> restoring it after the new window is closed? The new window is always
> opened on top of the main stdscr window.

You can retrieve a window's contents line-by-line or character-by-character
using one of the insstr/innwstr/inchnstr or inch variants.

> I see in the man pages that there's a scr_dump() and scr_restore()
> which might do what I want. but these expect to use files, and I'd like
> to store the screen state in memory instead.

> --
> Simon Elliott    http://www.ctsn.co.uk

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net





[ Post a follow-up to this message ]



    Re: curses: saving and restoring window chars/colours  
Simon Elliott


Report This Message To A Moderator Edit/Delete Message


 
11-22-05 12:50 PM

On 22/11/2005, Thomas Dickey wrote:

> For this case, you would touch the window that you want to redisplay.
> The panel library does this in general, but touchwin/wrefresh work
> for special cases.

Thanks. I was wondering if I'd have to make a pad and call overwrite()
to save the data, but this is much simpler.

--
Simon Elliott    http://www.ctsn.co.uk





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:40 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register