Re: [Pyobjc-dev] Multiple Document App Template
Brought to you by:
ronaldoussoren
From: Bill B. <bb...@co...> - 2003-01-14 16:11:06
|
On Tuesday, Jan 14, 2003, at 10:46 US/Eastern, Bob Ippolito wrote: > Well the only thing I can think of off the top of my head is that > there could be some apple event magic happening that causes the new > untitled document event, and the apple event just isn't being handled? Damn. Figured it out. Yuck. If I add... def application_openFile_(self, sender, path): NSLog("application_openFile_() %s %s" % (sender, path)) return YES ... to the app delegate, this is logged: 2003-01-14 10:59:53.731 doctest[17445] application_openFile_() <NSApplication objective-c instance 0x2c0cb0> /tmp/bbum-products/doctest.app/Contents/Resources/__main__.py In other words, the command line that is passed into python needs to be massaged before NSApplicationMain() is called. Specifically, the path to the main.py file needs to be stripped and it needs to be done from the C side because NSApplicationMain() ignores the argv argument passed into it. Fun, fun. Will look into this later today when I have some time... b.bum |