home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / lisp / mcl / 1921 < prev    next >
Encoding:
Internet Message Format  |  1992-12-31  |  1.9 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!sun-barr!ames!olivea!apple!cambridge.apple.com!bill@cambridge.apple.com
  2. From: bill@cambridge.apple.com (Bill St. Clair)
  3. Newsgroups: comp.lang.lisp.mcl
  4. Subject: Re: Views and keystrokes
  5. Message-ID: <9212311706.AA14955@cambridge.apple.com>
  6. Date: 31 Dec 92 17:06:01 GMT
  7. Sender: info-mcl-request@cambridge.apple.com
  8. Lines: 31
  9. Approved: comp.lang.lisp.mcl@Cambridge.Apple.C0M
  10.  
  11. >> The only problem is that you need to define a dialog-item-enabled-p
  12. >> method for your key handler class
  13. >
  14. >Bill,
  15. >  Thanks for the clue.  I saw the error message complaining that no 
  16. >"dialog-item-enabled-p" was defined for my view class, but I assumed
  17. >that I was on the wrong track, since I wasn't trying to define a 
  18. >dialog item.  One last question.  After implementing the patch I get
  19. >most key strokes, but I can only get access to a #\Tab key if I hold
  20. >down the shift-tab combination.  Is this because the window now thinks
  21. >that the view is a dialog item?  Below is the code that prints out
  22. >any keys that it gets:
  23.  
  24. (method view-key-event-handler (window t)) only passes tab & return
  25. characters to the current-key-handler if it returns true for
  26. allow-tabs-p & allow-returns-p respectively. The default is for the
  27. tab character to switch to another key handler and the return character
  28. to select a default button. The easiest way to make your key handler
  29. get these characters is with the :allow-tabs & :alow-returns initargs
  30. (to key-handler-mixin). You can also use the set-allow-tabs &
  31. set-allow-returns functions.
  32.  
  33. (setf temp-wind
  34.       (make-instance 'special-window
  35.         :view-subviews
  36.         (list (setf temp-view
  37.                     (make-instance 'special-view
  38.                       :view-position #@(40 40)
  39.                       :view-size #@(150 150)
  40.                       :allow-tabs t
  41.                       :allow-returns t)))))
  42.