[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Views and keystrokes



>> The only problem is that you need to define a dialog-item-enabled-p
>> method for your key handler class
>
>Bill,
>  Thanks for the clue.  I saw the error message complaining that no 
>"dialog-item-enabled-p" was defined for my view class, but I assumed
>that I was on the wrong track, since I wasn't trying to define a 
>dialog item.  One last question.  After implementing the patch I get
>most key strokes, but I can only get access to a #\Tab key if I hold
>down the shift-tab combination.  Is this because the window now thinks
>that the view is a dialog item?  Below is the code that prints out
>any keys that it gets:

(method view-key-event-handler (window t)) only passes tab & return
characters to the current-key-handler if it returns true for
allow-tabs-p & allow-returns-p respectively. The default is for the
tab character to switch to another key handler and the return character
to select a default button. The easiest way to make your key handler
get these characters is with the :allow-tabs & :alow-returns initargs
(to key-handler-mixin). You can also use the set-allow-tabs &
set-allow-returns functions.

(setf temp-wind
      (make-instance 'special-window
        :view-subviews
        (list (setf temp-view
                    (make-instance 'special-view
                      :view-position #@(40 40)
                      :view-size #@(150 150)
                      :allow-tabs t
                      :allow-returns t)))))