Re: [Pyobjc-dev] Re: interface builder queries
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2003-08-29 12:10:55
|
On Friday, 29 August 2003, at 13:51, Michael Hudson wrote: >> Thanks for reminding me of this issue. I had noticed this when >> building the preference panes, but didn't think this was very >> important at the time. I'll see what I can do about this, this may be >> a hard problem. > > It looks it. There's this intriguingly named function > _NSBundleAddClassesAndNotify, but I don't think you're expected to > call it... Hmm, I hadn't looked at global functions yet. The private methods didn't look interesting. > > Also, the feeling I get is that there's lot of hacking done to get > this sort of thing to work from Java, and it would probably take > someone from Apple to do the same for Python. That may be too > pessimistic, though. We probably need support from Apple to get this to work reliably, I haven't found a documented API to register our classes. > > The nicest answer would be arrange for our bundle to load itself into > some subclass of NSBundle, but that doesn't look possible (and Mach-O > bundles don't even seem to have init sections, which rules out one > scary hack that occurred to me). They seem to have init sections, and you can use the +load method of classes as well. I use the latter to bootstrap Python based bundles, because I can get at the current bundle that way, which is handy for locating resources such as the python code. My current idea for a hack to implement this is to dynamicly replace the 'isa' pointer of Python based bundles from that +load method. As longs as IB uses [bundle classNamed:] we would get a working situtation (although using an extremely ugly hack). This seems to be the week for ugly hacks, I'm working on a full-screen application (using PyObjC of course) that uses pop-up buttons. Those don't work in full-screen mode, the pop-up menu seems to be behind my full-screen window. I've already filed a bug after someone else noticed he hadn't had any luck getting this to work and just avoids pop-up buttons. I haven't found a way to hack around this limitation :-(. Ronald |