Changeset main,37


Ignore:
Timestamp:
11/07/2007 05:12:27 AM (19 years ago)
Author:
David Owen <dsowen@…>
branch-nick:
tui-new
revision id:
dsowen@fugue88.ws-20071107051227-wbmsan3mivf9n3qg
Message:

Return the value that the callback returns when not nil.
Force refresh on state change.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/textbox.lisp

    r36 r37  
    4141    (erase window)
    4242    (add-clipped-string window 0 (- scroll) (text data))
    43     (setf (cursor-position window) (list 0 (screen-cp textbox)))))
     43    (setf (cursor-position window) (list 0 (screen-cp textbox)))
     44    (refresh window)))
    4445
    4546(defmethod (setf insertion-point) :around (i (textbox textbox))
     
    113114           (t
    114115            (if (or (keywordp key) (member key '(#\Return #\Tab #\Esc)))
    115                 (when (funcall callback key)
    116                   (setf (insertion-point textbox) 0)
    117                   (return-from activate-textbox))
     116                (let ((r (funcall callback key)))
     117                  (when r
     118                    (setf (insertion-point textbox) 0)
     119                    (return-from activate-textbox r)))
    118120                (multiple-value-bind (left right) (split textbox)
    119121                  (setf (text data)
Note: See TracChangeset for help on using the changeset viewer.