home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.next.programmer
- Path: sparky!uunet!psinntp!afs!greg
- From: greg@afs.com (Gregory H. Anderson)
- Subject: Re: NXBRowsers and Arrow Keys
- Message-ID: <1992Nov19.164632.481@afs.com>
- Sender: greg@afs.com
- Reply-To: greg@afs.com
- References: <1992Nov17.191020.15855@cs.mcgill.ca>
- Date: Thu, 19 Nov 1992 16:46:32 GMT
- Lines: 38
-
- In article <1992Nov17.191020.15855@cs.mcgill.ca> samurai@cs.mcgill.ca
- (Darcy BROCKBANK) writes:
- > Can someone tell me the trick used to make the NXBrowser work
- > with arrow keys?
- >
- > The docs say do this:
- >
- > [myBrowser acceptArrowKeys:YES andSendActionMessages:YES]
- >
- > And that's all you need. The browser should then respond to
- > - acceptsFirstResponder with YES, which it does, but even if
- > I programatically tell it - becomeFirstResponder the arrow
- > keys never get through to it (and I get the system beep).
-
- You've got the responder chain management backwards. You need to say
-
- [theBrowsersWindow makeFirstResponder:theBrowser]
-
- because -becomeFirstResponder is a message from the Window to the object,
- as a form of command: "I've decided (or I've been told) that it's your
- turn to take the baton." And in fact, the object can refuse to
- becomeFirstResponder by returning nil! So you have to message the Window
- to get the work done. It will send -becomeFirstResponder for you.
-
- We also say
-
- [theBrowser useScrollButtons: YES];
- [[theBrowser matrixInColumn:0] selectCellAt: 0 : 0];
-
- but I don't know whether these make a difference or not for the arrow
- keys. Try it!
-
-
- --
- Gregory H. Anderson | Thus spake the master programmer:
- Master Programmer / Manager | "Let the programmers be many and
- Anderson Financial Systems | the managers few; then all will be
- greg@afs.com (Nextmail OK) | productive." -- Tao of Programming
-