Changeset main,36


Ignore:
Timestamp:
11/06/2007 04:20:29 PM (19 years ago)
Author:
David Owen <dsowen@…>
branch-nick:
tui-new
revision id:
dsowen@fugue88.ws-20071106162029-m13nua6uabv5zsyk
Message:

Move insertion point to end on activation, and beginning on deactivation.
Callback is optional; default does nothing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/textbox.lisp

    r35 r36  
    8585              (subseq s insertion-point (length s))))))
    8686
    87 (defun activate-textbox (textbox callback)
     87(defun nothing (dummy)
     88  (declare (ignore dummy)))
     89
     90(defun activate-textbox (textbox &optional (callback 'nothing))
    8891  (with-slots (data window) textbox
    8992    (cdk::c-keypad (window-pointer window) t)
     93    (setf (insertion-point textbox) :end)
    9094    (loop
    9195       (let ((key (read-key window)))
     
    110114            (if (or (keywordp key) (member key '(#\Return #\Tab #\Esc)))
    111115                (when (funcall callback key)
     116                  (setf (insertion-point textbox) 0)
    112117                  (return-from activate-textbox))
    113118                (multiple-value-bind (left right) (split textbox)
Note: See TracChangeset for help on using the changeset viewer.