Changeset main,86


Ignore:
Timestamp:
02/15/2008 09:27:44 PM (15 years ago)
Author:
David Owen <dsowen@…>
branch-nick:
tui
revision id:
dsowen@fugue88.ws-20080215212744-nvsfm7il0t5cx7ki
Message:

Can now suspend ncurses to shell out to other programs.

Location:
main/window
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/window/generic.lisp

    r66 r86  
    1818   #:screen-window-destruction-error
    1919   #:with-screen
     20   #:without-screen
    2021   #:with-screen-window))
    2122
  • main/window/screen.lisp

    r82 r86  
    2727(defcfun "endwin" :int)
    2828
     29(defvar *screen*)
     30
    2931(defmacro with-screen ((screen) &body body)
    3032  (with-gensyms (ptr)
     
    3840                (let ((j (1+ i)))
    3941                  (init-pair j (mod j 8) (floor j 8))))
    40               (let ((,screen (make-instance 'screen-window :ptr ,ptr)))
     42              (let* ((*screen* (make-instance 'screen-window :ptr ,ptr))
     43                     (,screen *screen*))
    4144                ,@body))
    4245         (endwin)))))
     46
     47(defmacro without-screen (&body body)
     48  `(unwind-protect
     49        (progn
     50          (endwin)
     51          (progn ,@body))
     52     (refresh *screen*)))
    4353
    4454
Note: See TracChangeset for help on using the changeset viewer.