From fdd47211ac8fe0374440bc17c2c7ba69c974c097 Mon Sep 17 00:00:00 2001 From: eknauel Date: Tue, 27 Sep 2005 16:32:19 +0000 Subject: [PATCH] Modal windows part of darcs patch Wed Sep 21 20:52:34 EEST 2005 Martin Gasbichler --- scheme/nuit-engine.scm | 10 +++++++++- scheme/nuit-packages.scm | 21 ++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/scheme/nuit-engine.scm b/scheme/nuit-engine.scm index 9360ba3..5548d9d 100644 --- a/scheme/nuit-engine.scm +++ b/scheme/nuit-engine.scm @@ -412,7 +412,14 @@ (completion-selector #f)) (cond - + (maybe-modal-window + (if (maybe-modal-window ch) + (begin + (paint) + (when (current-history-item) + (paint-result-window (entry-data (current-history-item))) + (refresh-result-window)))) + (loop (wait-for-input) c-x-pressed? completion-selector)) ;; Ctrl-x -> wait for next input ((= ch key-control-x) (loop (wait-for-input) #t completion-selector)) @@ -877,3 +884,4 @@ ;; #### FIXME we loose a character this way (focus-command-buffer!) #f)))) + diff --git a/scheme/nuit-packages.scm b/scheme/nuit-packages.scm index 7eca9a7..1ad4ac3 100644 --- a/scheme/nuit-packages.scm +++ b/scheme/nuit-packages.scm @@ -98,7 +98,9 @@ app-window-y app-window-height app-window-width - app-window-curses-win)) + app-window-curses-win + app-window-init-curses-win! + delete-app-window!)) (define-interface nuit-windows-interface (export bar-1 @@ -153,6 +155,9 @@ srfi-8 srfi-26 + modal-window + app-windows + objects configuration focus-table ncurses @@ -861,6 +866,19 @@ handle-fatal-error) (files config)) +;;; modal window + +(define-interface modal-window-interface + (export + maybe-modal-window + set-modal-window! + close-modal-window!)) + +(define-structure modal-window modal-window-interface + (open scheme + signals) + (files modal-window)) + ;;; nuit (define-interface nuit-interface @@ -896,6 +914,7 @@ app-windows initial-tty nuit-windows + modal-window configuration command-line-parser