home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.programmer
- Path: sparky!uunet!munnari.oz.au!manuel!csc.canberra.edu.au!news
- From: Kim Holburn <kim@csc.canberra.edu.au>
- Subject: Re: curses overlapping windows
- Message-ID: <1992Aug27.004104.1099@csc.canberra.edu.au>
- X-Xxdate: Thu, 27 Aug 92 18:56:41 GMT
- Sender: news@csc.canberra.edu.au
- Organization: University of Canberra
- X-Useragent: Nuntius v1.1.1d7
- Date: Thu, 27 Aug 92 00:41:04 GMT
- Lines: 88
-
- Thanks for responding. If anyone else is interested here are some
- responses.
- The simplest way was from Steve Kirkendall (kirkenda@eecs.ee.pdx.edu)
-
- >>Hi folks,
- >> I have a problem that someone more familiar with curses may be able
- to
- >>advise me on. I have a curses progrm that has a number of windows on
- the
- >>screen. I want to put up an alert window occasionally then get rid of
- it
- >>and have the windows underneath redraw themselves. It's not very easy
- to
- >>extremely difficult to know what windows are on the screen. Currently I
- have
- >>to update each window that the alert covered (with a touchwin). A
- touchwin on
- >>the alert window doesn't seem to work.
- >>
- >>Is there an easy way of doing this?
-
- >Save a copy of the current screen image before you create your alert
- window,
- >and then refresh the saved image afterward to erase it...
- >
- > WINDOW *oldscr = newwin(0,0,0,0);
- > overwrite(curscr, oldscr);
- >
- > /* insert alert-window stuff here */
- >
- > touchwin(oldscr);
- > wrefresh(oldscr);
- > delwin(oldscr);
- >
-
- barrie@calvin.demon.co.uk wrote:
-
- >I suggest that you have a look at/for panels. The panel library performs
- >the functions that you are looking for - all you do is open a panel for
- >each curses window and use a couple of panel function calls to update the
- >screen. Panels are supplied on SCO unix (as part of SYS Vr3.2). I think
- that
- >it is standard in SVr4. u386mon (a 386 unix system monitor) supplies a
- working
- >implementation of panels for systems without the native library - we've
- used it
- >on Intergraph clippers (CLIX is System V r3.1) and Suns (SunOS 4.1.*,
- using
- >terminfo curses).
- >
- >Barrie
-
- From: Matt Day <mday@icon.com>
-
- >>Is there an easy way of doing this?
- >
- >Not really. There is another function which might accomplish what you
- >want more efficiently than touchwin(). The Berkeley curses routine
- >touchoverlap(WINDOW *win1, WINDOW *win2) touches the window "win2" in
- >the area which overlaps with "win1". It doesn't touch anything in
- >areas which don't overlap (and therefore don't need updating).
- >
- >I say "Berkeley curses route" because touchoverlap() doesn't seem to be
- >part of System V. If you are using System V, check back with me
- >because I think there's something similar.
- >
- >By the way, the reason a touchwin() on the alert window doesn't seem to
- >work is because the alert window is probably already completely in the
- >foreground, so marking every location on that window "changed" wouldn't
- >change the way the screen looks.
- >
- >Also, if you are using Berkeley curses, you might want to find the
- >essential "Screen Updating and Cursor Movement Optimization: A Library
- >Package" paper by Ken Arnold. It should be in the printed manuals
- >somewhere.
-
-
- Thanks folks
- +----------------------------+-----------------------------------------+
- | Kim Holburn | Internet : kim@csc.canberra.edu.au |
- | Computer Services Centre | |
- | University of Canberra | Phone : (06)201 2203, (06)201 2401 |
- | PO Box 1 Belconnen | |
- | ACT Australia | Fax : (06)201 5074 |
- +----------------------------+-----------------------------------------+
- | born again and again and again and again and again buddhist |
- | well... in a previous life anyway :-) |
- +----------------------------------------------------------------------+
-