Re: [Pyobjc-dev] New NibLoader.py
Brought to you by:
ronaldoussoren
From: <bb...@ma...> - 2002-11-16 23:25:53
|
On Saturday, November 16, 2002, at 06:00 PM, Just van Rossum wrote: > bb...@ma... wrote: > >> Actually, yes, I do mind. :-) > > Ok, I see your points, and I agree. Yet, maybe it can be simpler (this > _is_ > Python after all ;-). How about this: > > Load classes from nib named "nibName" from main bundle: > > loadClasses(nibName) > > Load classes from nib named "nibName" from bundle "aBundle": > > loadClasses(nibName, bundle=aBundle) > > Load classes from nib by file path: > > loadClasses(path=pathToNib) Works for me... elegant, as well. Clean in that way that is so natural to Python -- similar to the metaclass solution used by the nib loader to determine the base classes. I wasn't familiar with that, at all. > > [ ... ] >> So, all things considered, nothing really need be changed. I'm not >> sure what happens in Cocoa if you load two NIB files that have the >> same >> class defined but the intention was that they were to be different >> classes. [ ... ] > > (The code I ripped from AppKit/classnib.py asserts they have the same > baseclass; > the outlets and actions lists are merged.) Relatively undefined behavior in both cases, then -- defined, but probably not what the developer intended in either case. b.bum |