🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #2216

Re: InterfaceBuilder: No KeyAndOrderFront at app's startup??

#2216
From: Gordie Freedman
Date: Thu, 07 Jan 1993 06:13
49 lines
2709 bytes
In article <1993Jan5.130920.29274@oce.nl> fjh@oce.nl (Erik Hommersom) writes:
> Hi there,
> 
> When I start an application, made with InterfaceBuilder in a Terminal, 
> it is not activated, but the Terminal application remains the active
> application. 
> 
> Instead I would like to have MyApplication become active after it has been
> launched from a Terminal, without having to click on one of its windows. 
> 
> The problem I have is that I cannot figure out where to call the method
> "makeKeyAndOrderFront" if not in the main.m program generated by
> InterfaceBuilder?
> 
> Can someone tell me how to activate an application at startup under these
> conditions?
> 
> Thanks,
> 
> Erik Hommersom
> OCE Research & Development, Venlo, The Netherlands
> 
>       ###########################################################
>       #  This note does not necessarily represent the position  #
>       #     of Oce-Nederland B.V. Therefore no liability or     #
>       #      responsibility for whatever will be accepted.      #
>       ###########################################################

Ok. Assuming there is some class you have defined, and an instance of that  
class you have placed in Interface Builder - (if not, than define a class  
called Controller, instantiate an object in builder and implement the method I  
will describe now, as well as the delegate trick).

Set the object as the application delegate from within IB (I don't know if you  
know all this stuff and can't wait for me to get to the point, or if you are a  
newbie and don't know what I'm talking about - so if this doesn't make sense,  
email me for more info).

Implement the -appDidInit:sender instance method in the Controller class. It  
will get invoked on your object after the application inits, so you can do the  
makeKeyAndOrderFront then. Look in digi librarian in General Reference at the  
"Application" class  documentation - it explains this and more (like how to  
catch when the app is ending). 

Works on 3.0, I don't know about 2.x ...

-- 
>>> Gordie Freedman  -> gordie@cyclesoft.com   NeXTMail Yes! 
>>> Thou shalt not inline functions more complicated than 20 
Technical Details
Message-ID: <1993Jan7.061307.7471@netcom.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!usc!wupost!csus.edu!netcom.com!netcomsv!yamanote!gordie
References: <1993Jan5.130920.29274@oce.nl>

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!usc!wupost!csus.edu!netcom.com!netcomsv!yamanote!gordie
From: gordie@cyclesoft.com (Gordie Freedman)
Subject: Re: InterfaceBuilder: No KeyAndOrderFront at app's startup??
Message-ID: <1993Jan7.061307.7471@netcom.com>
Sender: gordie@netcom.com
Reply-To: gordie@cyclesoft.com
Organization: Dolphin Software
References: <1993Jan5.130920.29274@oce.nl>
Date: Thu, 7 Jan 1993 06:13:07 GMT
Lines: 49