home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / programm / 4461 < prev    next >
Encoding:
Text File  |  1992-08-26  |  3.8 KB  |  101 lines

  1. Newsgroups: comp.unix.programmer
  2. Path: sparky!uunet!munnari.oz.au!manuel!csc.canberra.edu.au!news
  3. From: Kim Holburn <kim@csc.canberra.edu.au>
  4. Subject: Re: curses overlapping windows
  5. Message-ID: <1992Aug27.004104.1099@csc.canberra.edu.au>
  6. X-Xxdate: Thu, 27 Aug 92 18:56:41 GMT
  7. Sender: news@csc.canberra.edu.au
  8. Organization: University of Canberra
  9. X-Useragent: Nuntius v1.1.1d7
  10. Date: Thu, 27 Aug 92 00:41:04 GMT
  11. Lines: 88
  12.  
  13. Thanks for responding. If anyone else is interested here are some
  14. responses. 
  15. The simplest way was from Steve Kirkendall (kirkenda@eecs.ee.pdx.edu)
  16.  
  17. >>Hi folks,
  18. >>   I have a problem that someone more familiar with curses may be able
  19. to
  20. >>advise me on. I have a curses progrm that has a number of windows on
  21. the 
  22. >>screen. I want to put up an alert window occasionally then get rid of
  23. it 
  24. >>and have the windows underneath redraw themselves. It's not very easy
  25. to 
  26. >>extremely difficult to know what windows are on the screen. Currently I
  27. have 
  28. >>to update each window that the alert covered (with a touchwin). A
  29. touchwin on
  30. >>the alert window doesn't seem to work. 
  31. >>
  32. >>Is there an easy way of doing this?
  33.  
  34. >Save a copy of the current screen image before you create your alert
  35. window,
  36. >and then refresh the saved image afterward to erase it...
  37. >
  38. >     WINDOW    *oldscr = newwin(0,0,0,0);
  39. >    overwrite(curscr, oldscr);
  40. >
  41. >    /* insert alert-window stuff here */
  42. >
  43. >    touchwin(oldscr);
  44. >    wrefresh(oldscr);
  45. >    delwin(oldscr);
  46. >
  47.  
  48. barrie@calvin.demon.co.uk wrote:
  49.  
  50. >I suggest that you have a look at/for panels. The panel library performs 
  51. >the functions that you are looking for - all you do is open a panel for
  52. >each curses window and use a couple of panel function calls to update the
  53. >screen. Panels are supplied on SCO unix (as part of SYS Vr3.2). I think
  54. that
  55. >it is standard in SVr4. u386mon (a 386 unix system monitor) supplies a
  56. working
  57. >implementation of panels for systems without the native library - we've
  58. used it
  59. >on Intergraph clippers (CLIX is System V r3.1) and Suns (SunOS 4.1.*,
  60. using 
  61. >terminfo curses).
  62. >
  63. >Barrie
  64.  
  65. From: Matt Day <mday@icon.com>
  66.  
  67. >>Is there an easy way of doing this?
  68. >
  69. >Not really.  There is another function which might accomplish what you
  70. >want more efficiently than touchwin().  The Berkeley curses routine
  71. >touchoverlap(WINDOW *win1, WINDOW *win2) touches the window "win2" in
  72. >the area which overlaps with "win1".  It doesn't touch anything in
  73. >areas which don't overlap (and therefore don't need updating).
  74. >
  75. >I say "Berkeley curses route" because touchoverlap() doesn't seem to be
  76. >part of System V.  If you are using System V, check back with me
  77. >because I think there's something similar.
  78. >
  79. >By the way, the reason a touchwin() on the alert window doesn't seem to
  80. >work is because the alert window is probably already completely in the
  81. >foreground, so marking every location on that window "changed" wouldn't
  82. >change the way the screen looks.
  83. >
  84. >Also, if you are using Berkeley curses, you might want to find the
  85. >essential "Screen Updating and Cursor Movement Optimization: A Library
  86. >Package" paper by Ken Arnold.  It should be in the printed manuals
  87. >somewhere.
  88.  
  89.  
  90. Thanks folks
  91. +----------------------------+-----------------------------------------+
  92. |   Kim Holburn              |   Internet : kim@csc.canberra.edu.au    |
  93. |   Computer Services Centre |                                         |
  94. |   University of Canberra   |   Phone    : (06)201 2203, (06)201 2401 |
  95. |   PO Box 1 Belconnen       |                                         |
  96. |   ACT  Australia           |   Fax      : (06)201 5074               |
  97. +----------------------------+-----------------------------------------+
  98. |     born again and again and again and again and again buddhist      |
  99. |                    well... in a previous life anyway  :-)            |
  100. +----------------------------------------------------------------------+
  101.