Re: Multi-line-text-input-pane and the Return key
I recall doing something along these lines several years ago (probably
to detect loss of focus).
Look at :navigation-callback and :editing-callback and build a state
machine that tracks the state of the widget. FWIW, here's a note from
my code (LWW):
(defclass text-input-pane (capi:text-input-pane)
((state :initform nil)
(ended :initform nil) ;; correction for inconsistent state change
(see states below)
(model-update-callback :initarg :model-update-callback)
(model-slot :initarg :model-slot)
(fmt :initarg :fmt))
(:default-initargs
:callback-type :interface-item
:callback 'tip-fini
:model-slot nil
:buttons '(:ok t :cancel t :cancel-function tip-cancel)
:fmt "~,4F"
:navigation-callback 'tip-editing
:editing-callback 'tip-editing))
;; possible paths vs. callbacks
;; edit, hit enter -> START, RETURN, END
;; edit, hit TAB -> START, TAB-FORWARD, END
;; edit, click to focus elsewhere -> START, END
;; edit, click check-mark -> START, tip-fini
;; edit, click check-mark, call do-update -> START, tip-fini, END
pt
_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html