home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / next / programm / 7348 < prev    next >
Encoding:
Text File  |  1992-11-20  |  1.8 KB  |  50 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!psinntp!afs!greg
  3. From: greg@afs.com (Gregory H. Anderson)
  4. Subject: Re: NXBRowsers and Arrow Keys
  5. Message-ID: <1992Nov19.164632.481@afs.com>
  6. Sender: greg@afs.com
  7. Reply-To: greg@afs.com
  8. References: <1992Nov17.191020.15855@cs.mcgill.ca>
  9. Date: Thu, 19 Nov 1992 16:46:32 GMT
  10. Lines: 38
  11.  
  12. In article <1992Nov17.191020.15855@cs.mcgill.ca> samurai@cs.mcgill.ca  
  13. (Darcy BROCKBANK) writes:
  14. > Can someone tell me the trick used to make the NXBrowser work
  15. > with arrow keys?
  16. > The docs say do this:
  17. > [myBrowser acceptArrowKeys:YES andSendActionMessages:YES]
  18. > And that's all you need. The browser should then respond to
  19. > - acceptsFirstResponder with YES, which it does, but even if
  20. > I programatically tell it - becomeFirstResponder the arrow
  21. > keys never get through to it (and I get the system beep).
  22.  
  23. You've got the responder chain management backwards. You need to say
  24.  
  25. [theBrowsersWindow makeFirstResponder:theBrowser]
  26.  
  27. because -becomeFirstResponder is a message from the Window to the object,  
  28. as a form of command: "I've decided (or I've been told) that it's your  
  29. turn to take the baton." And in fact, the object can refuse to  
  30. becomeFirstResponder by returning nil! So you have to message the Window  
  31. to get the work done. It will send -becomeFirstResponder for you.
  32.  
  33. We also say
  34.  
  35. [theBrowser useScrollButtons: YES];
  36. [[theBrowser matrixInColumn:0] selectCellAt: 0 : 0];
  37.  
  38. but I don't know whether these make a difference or not for the arrow  
  39. keys. Try it!
  40.  
  41.  
  42. --
  43. Gregory H. Anderson          | Thus spake the master programmer: 
  44. Master Programmer / Manager  | "Let the programmers be many and  
  45. Anderson Financial Systems   | the managers few; then all will be 
  46. greg@afs.com  (Nextmail OK)  | productive." -- Tao of Programming
  47.