- Timestamp:
- 11/13/2007 04:31:46 PM (19 years ago)
- branch-nick:
- tui
- revision id:
- dsowen@fugue88.ws-20071113163146-2c9661gfdiyqnwbf
- Location:
- main
- Files:
-
- 2 edited
-
flat-menu.lisp (modified) (3 diffs)
-
window/screen.lisp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
main/flat-menu.lisp
r39 r48 1 1 (defpackage #:flat-menu 2 (:use #:cl #:cffi )2 (:use #:cl #:cffi #:dso-util #:tui-input #:tui-output #:tui-window) 3 3 (:export #:*shortcut-style* #:*highlight-style* #:menu #:selected 4 4 #:make-menu)) … … 26 26 (multiple-value-bind (s1 s2 s3) (break-text text shortcut-pos) 27 27 (when highlight 28 (cdk::c-wattron window*highlight-style*))29 ( cdk::move-and-add-string window row column s1)30 (cdk::c-wattron window*shortcut-style*)31 ( cdk::move-and-add-string window row (incf column (length s1)) s2)32 (cdk::c-wattroff window*shortcut-style*)33 ( cdk::move-and-add-string window row (incf column (length s2)) s3)28 (cdk::c-wattron (window-pointer window) *highlight-style*)) 29 (move-and-add-string window row column s1) 30 (cdk::c-wattron (window-pointer window) *shortcut-style*) 31 (move-and-add-string window row (incf column (length s1)) s2) 32 (cdk::c-wattroff (window-pointer window) *shortcut-style*) 33 (move-and-add-string window row (incf column (length s2)) s3) 34 34 (when highlight 35 (cdk::c-wattroff window*highlight-style*)))))35 (cdk::c-wattroff (window-pointer window) *highlight-style*))))) 36 36 37 37 … … 89 89 (with-accessors ((selected selected)) menu 90 90 (loop 91 ( cdk::c-refresh-windowwindow)92 (let ((ch ( cdk::c-wgetchwindow)))93 (c ond94 ( (= ch 258)91 (refresh window) 92 (let ((ch (read-key window))) 93 (case ch 94 (:key-down 95 95 (incf selected)) 96 ( (= ch 259)96 (:key-up 97 97 (decf selected)) 98 98 (t (return)))))))) 99 99 100 100 (defun test () 101 ( let ((screen (cdk::c-init-curses-screen)))101 (with-screen (screen) 102 102 (cdk::c-cbreak) 103 103 (cdk::c-noecho) 104 104 (cdk::c-nonl) 105 (cdk::c-keypad screent)106 ( cdk::c-erase-windowscreen)105 (cdk::c-keypad (window-pointer screen) t) 106 (erase screen) 107 107 (let ((menu (make-menu screen 5 10 '(("Hello, world!" 7) ("Goodbye, galaxy!" 9))))) 108 (activate-menu menu)) 109 (cdk::c-end-curses))) 108 (activate-menu menu)))) -
main/window/screen.lisp
r41 r48 36 36 (dotimes (i 63) 37 37 (let ((j (1+ i))) 38 (init-pair j ( floor j 8) (modj 8))))38 (init-pair j (mod j 8) (floor j 8)))) 39 39 (let ((,screen (make-instance 'screen-window :ptr ,ptr))) 40 40 ,@body)
Note: See TracChangeset
for help on using the changeset viewer.
