home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.lisp.mcl
- Path: sparky!uunet!destroyer!ncar!uchinews!tango.uchicago.edu!mcdougal
- From: Tom McDougal <mcdougal@cs.uchicago.edu>
- Subject: Re: parallel text dialog items
- Message-ID: <1992Nov11.203652.13115@midway.uchicago.edu>
- X-Xxmessage-Id: <A726C7D6B0071453@tango.uchicago.edu>
- X-Xxdate: Wed, 11 Nov 92 20:23:18 GMT
- Sender: news@uchinews.uchicago.edu (News System)
- Organization: Univ. of Chicago Computer Science
- X-Useragent: Nuntius v1.1.1d12
- References: <1992Nov9.170736.5118@midway.uchicago.edu>
- Date: Wed, 11 Nov 1992 20:36:52 GMT
- Lines: 45
-
- First, there was a biiiig mistake in my original code, which
- should have been obvious. See if you can spot it:
-
- >> (defclass twin-text-item (aligned-text-dialog-item)
- >> ((brother :accessor brother :initarg :brother
- >> :type 'text-edit-dialog-item)))
- >>
- >> (defmethod key-event-handler :after ((self twin-text-item) char)
- >> (key-event-handler (brother self) char))
-
- See it? 'key-event-handler' should have been
- 'view-key-event-handler'.
-
- Given that correction, the code above works for instances of
- editable-text-dialog-item, but not for instances of
- text-edit-dialog-item (defined in the examples folder). In the latter
- case, duplicates of each keystroke end up going to the same view.
- Why?
-
- It seems as though keystrokes are always handled by the window's
- key-event-handler. So the following correction works:
-
- (defmethod view-key-event-handler :after ((self twin-text-item) char)
- ; change the window's key event handler to BROTHER's handler
- (set-key-event-handler (view-container self)
- (key-event-handler (brother self)))
- ; process the keystroke again
- (view-key-event-handler (brother self) char)
- ; restore SELF's handler as window's key event handler
- (set-key-event-handler (view-container self) (key-event-handler
- self)))
-
- All suggestions have involved using editable-text-dialog-items, which
- I will use if necessary, but the whole reason for going to text-edit-
- dialog-items was to avoid the extra bulk of fred dialog items.
-
- Anyway, thanks for the tips.
-
- ----------------------------------------------------------------------
- -Tom McDougal mcdougal@cs.uchicago.edu (312) 702-0024
- Dept. of Computer Science, University of Chicago
-
- 1051, Lady Godiva puts everything she has
- on a horse. Citizens of Coventry place bets
- for Godiva to show.
-