home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / next / programm / 8018 < prev    next >
Encoding:
Text File  |  1993-01-07  |  2.6 KB  |  62 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!wupost!csus.edu!netcom.com!netcomsv!yamanote!gordie
  3. From: gordie@cyclesoft.com (Gordie Freedman)
  4. Subject: Re: InterfaceBuilder: No KeyAndOrderFront at app's startup??
  5. Message-ID: <1993Jan7.061307.7471@netcom.com>
  6. Sender: gordie@netcom.com
  7. Reply-To: gordie@cyclesoft.com
  8. Organization: Dolphin Software
  9. References: <1993Jan5.130920.29274@oce.nl>
  10. Date: Thu, 7 Jan 1993 06:13:07 GMT
  11. Lines: 49
  12.  
  13. In article <1993Jan5.130920.29274@oce.nl> fjh@oce.nl (Erik Hommersom) writes:
  14. > Hi there,
  15. > When I start an application, made with InterfaceBuilder in a Terminal, 
  16. > it is not activated, but the Terminal application remains the active
  17. > application. 
  18. > Instead I would like to have MyApplication become active after it has been
  19. > launched from a Terminal, without having to click on one of its windows. 
  20. > The problem I have is that I cannot figure out where to call the method
  21. > "makeKeyAndOrderFront" if not in the main.m program generated by
  22. > InterfaceBuilder?
  23. > Can someone tell me how to activate an application at startup under these
  24. > conditions?
  25. > Thanks,
  26. > Erik Hommersom
  27. > OCE Research & Development, Venlo, The Netherlands
  28. >       ###########################################################
  29. >       #  This note does not necessarily represent the position  #
  30. >       #     of Oce-Nederland B.V. Therefore no liability or     #
  31. >       #      responsibility for whatever will be accepted.      #
  32. >       ###########################################################
  33.  
  34. Ok. Assuming there is some class you have defined, and an instance of that  
  35. class you have placed in Interface Builder - (if not, than define a class  
  36. called Controller, instantiate an object in builder and implement the method I  
  37. will describe now, as well as the delegate trick).
  38.  
  39. Set the object as the application delegate from within IB (I don't know if you  
  40. know all this stuff and can't wait for me to get to the point, or if you are a  
  41. newbie and don't know what I'm talking about - so if this doesn't make sense,  
  42. email me for more info).
  43.  
  44. Implement the -appDidInit:sender instance method in the Controller class. It  
  45. will get invoked on your object after the application inits, so you can do the  
  46. makeKeyAndOrderFront then. Look in digi librarian in General Reference at the  
  47. "Application" class  documentation - it explains this and more (like how to  
  48. catch when the app is ending). 
  49.  
  50. Works on 3.0, I don't know about 2.x ...
  51.  
  52. -- 
  53. >>> Gordie Freedman  -> gordie@cyclesoft.com   NeXTMail Yes! 
  54. >>> Thou shalt not inline functions more complicated than 20 
  55.