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

Re- View-Key-Event-Handler

To:   Danny Brewer    danny@farallon.com
cc:   info-mcl
From: Steve Mitchell
Date: 02-13-92
Sub:    View-Key-Event-Handler
> I'm having trouble fully understanding VIEW-KEY-EVENT-HANDLER....
> what if one of my subviews isn't an editable dialog item, yet
> I want it to get keystrokes?  For example:
> [...]
>   (:DEFAULT-INITARGS :VIEW-POSITION #@(10 10) :VIEW-SIZE #@(50 50)))
> [...]
> How do I get the view to get keystrokes?  How can I make it a key
> handler?  How do I add it to the list of key handlers for the window?
Your item must inherit from key-handler-mixin:
(DEFCLASS MyView (key-handler-mixin DIALOG-ITEM) ()
(The superclasses must be specified in this order). Now your example
works as you intended. You could base your item on the predefined class
ccl::basic-editable-text-dialog-item, which itself has these superclasses.
> I sure would like to understand the entire mechanism better.
I'll bet you do now. Isn't CLOS beautiful? If you want to go further and
create key-receiving items that are editable, see the example file
text-edit-dialog-item.lisp, which does exactly that.