home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / next / programm / 6153 < prev    next >
Encoding:
Text File  |  1992-09-14  |  2.2 KB  |  52 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!zaphod.mps.ohio-state.edu!rpi!batcomputer!cornell!uw-beaver!uw-coco!nwnexus!sounds!brianw
  3. From: BrianW@SoundS.WA.com (Brian Willoughby)
  4. Subject: Re: (?) IB: setting up nexttext
  5. Message-ID: <BuL1F7.JEp@sounds.wa.com>
  6. Sender: brianw@sounds.wa.com (Brian Willoughby)
  7. Reply-To: BrianW@SoundS.WA.com
  8. Organization: SoundSoftware, Bellevue, WA, USA
  9. References: <1992Sep5.053408.2427@count0.cmhnet.org>
  10. Date: Mon, 14 Sep 1992 19:13:54 GMT
  11. Lines: 39
  12.  
  13. Charles G. Bennett writes
  14. | emurphy@cs.uno.edu (Edward Murphy) writes:
  15. | > [...] i'm putting together a app with two objects. a "form" and a  
  16. | > "scrollview". i'd like to be able to tab from the last formcell to the  
  17. | > scrollview's text window.  [...]
  18. | >
  19. | > incidently, when i set the nexttext of the form to be the scrollview it  
  20. | > crashes with the message...
  21. | >
  22. | > error: ScrollView does not recognize selector -selectText:
  23. | set the forms target to the scrollviews docView..
  24. | -- 
  25. | Chuck Bennett, BenaTong Consulting
  26. | cgb@count0.cmhnet.org
  27.  
  28. Chuck's idea should work if executed programmatically (I haven't verified it,  
  29. though), perhaps within -appDidInit you could make this connection with a call  
  30. to -setTarget (I couldn't make the connection to the docView within IB).
  31.  
  32. However, if you would like a solution which should work from within IB, try  
  33. this:
  34.  
  35. Write a category of ScrollView which implements the -selectText: method.   
  36. Within this method you can find the appropriate docView and make it the  
  37. firstResponder, after placing the cursor where you would like it to be if it  
  38. isn't already there.
  39.  
  40. This approach should work no matter how many different Form/ScrollView pairs  
  41. you have.  Just hook any two of them up with IB by double-clicking the nextText  
  42. outlet.  No need to manually set the target within your code.
  43.  
  44. I haven't verified this for ScrollViews, but I've done the exact same thing  
  45. with NXBrowsers to allow tabbing into and out of a browser from other Forms in  
  46. a panel.
  47. -- 
  48. Brian Willoughby    Software Design Engineer, BSEE NCSU
  49. BrianW@SoundS.WA.com    Sound Signal Processing Software and Consulting
  50. NeXTmail welcome    - NO EMAIL SOLICITATION without prior permission
  51.