Re: [Pyobjc-dev] Multiple Document App Template
Brought to you by:
ronaldoussoren
From: Bob I. <bo...@re...> - 2003-01-15 00:36:03
|
On Tuesday, Jan 14, 2003, at 19:24 America/New_York, Bill Bumgarner wrote: > On Tuesday, Jan 14, 2003, at 19:07 US/Eastern, Bob Ippolito wrote: >> a method for morphing a console app started with ANY command line >> into a Cocoa app, even if it's not in a bundle or has been running a >> while as a console app and Cocoa wasn't linked in at the time it >> started. > > Gave this some thought.... > > The trick is to do this before the ObjC runtime is touched in *any* > way. Even then, we may lose-- if the NSBundle/CFBundle has been > tripped by some other mechanism, we lose. > > So, dynamic loading works, but anything w/Foundation/Core linked in > may not work-- will not work in all cases. IIRC the undocumented CPSSetProcessName and CPSEnableForegroundOperation allowed me to get around that. Apple's jar runner uses this method, I saw that I was able to double-click a jar that wasn't in a bundle and it would still run and get representation in the dock.. so I tinkered around in gdb until I figured out how. > In any case, I really don't like hacks like this outside of the > 'ooh... that's a cool hacque' context. I'm bummed that it is now in > PyObjC, but it does work. I'm not necessarily advocating it either. I mostly wanted to know how Apple was doing it for Java... though it could be useful in certain circumstances [granted, all of them have workarounds, but it could mean time saved] for developers. |