[Pyobjc-dev] Subclassing from NibClassBuilder-generated files
Brought to you by:
ronaldoussoren
From: Jordan K. <jo...@kr...> - 2003-12-02 03:24:27
|
Going through the tutorial and other examples, I'm wondering why the (implied) common practice is to directly edit the NibClassBuilder-generated python files. Will regeneration upon changes in IB destroy changes to the file? I tried creating another file for CurrencyConverter which imported CurrencyConverter.py's classes (which were renamed to _Converter and _ConverterController), subclassed them, and attempted to call runEventLoop() from there, but the runtime is complaining that the classes already exist: File "Resources/t.py", line 6, in ? class Converter(_Converter): objc.error: Class already exists in Objective-C runtime Here's t.py: *snip* from PyObjCTools import NibClassBuilder, AppHelper from CurrencyConverter import Converter as _Converter from CurrencyConverter import ConverterController as _ConverterController class Converter(_Converter): pass class ConverterController(_ConverterController): pass AppHelper.runEventLoop() *snip* If this is in fact a problem, how does one get around this? Perhaps I'm just used to wxglade, where it exports classes to be used elsewhere, knowing that they will be generated often. If it's something else, please let me know :) On another documentation-related note: the nib in the tutorial (step3-MainMenu.nib.zip) actually has two Convert buttons, one on top of the other. J. |