From: Hans-Peter J. <hp...@ur...> - 2002-02-25 00:10:00
|
Hi Riaan et al., following the docs on "Special frame attributs", I try to control my layouts this way (on the main frame): [...] import config [...] class MainUI(wxFrame): _custom_classes = {'wxScrolledWindow': ['FaxView', 'wxScrolledWindow'], 'wxPanel': ['FaxList', 'wxPanel']} [...] def _init_ctrls(self, prnt): [...] self.mainSplitter.SplitHorizontally(self.listSplitter, self.viewSplitter, self.MainSplit) [...] def __init__(self, parent): self.initdone = false self.minPaneSize = 0 # fine self.SashSize = 5 # fine self.MainSplit = 180 # design time value self.cfg = config.Config() self.cfg.load() self.MainSplit = self.cfg.MainSplit # run time value self._init_ctrls(parent) [...] but this results in KeyError: MainSplit during Designer launch: 00:53:13: config.Config() 00:53:13: name 'config' is not defined 00:53:14: KeyError: MainSplitTraceback (most recent call last): 00:53:14: KeyError: MainSplit File "Controllers.py", line 778, in OnDesigner 00:53:14: self.showDesigner() 00:53:14: File "Controllers.py", line 830, in showDesigner 00:53:14: designer.refreshCtrl() 00:53:14: File "Views/Designer.py", line 351, in refreshCtrl 00:53:14: self.finaliseDepLinks(depLnks) 00:53:14: File "Views/InspectableViews.py", line 329, in finaliseDepLinks 00:53:14: self.applyDepsForCtrl(ctrlName, depLinks) 00:53:14: File "Views/InspectableViews.py", line 303, in applyDepsForCtrl 00:53:14: refs.append(self.objects[Utils.ctrlNameFromSrcRef(param)][1]) 00:53:14: KeyError: MainSplit No matter how I instanciate my config class, I get this key error. Any ideas? Also, I would like to pass my config instance to my subclasses in the constructor. The docs say, this is a nono, because it's neither a simple nor a wxPython type. I workaround this with a Config method in the subclass, but again: Parameter, which modify appearance have to be handled manually and disturb screen appearance on start up (gets drawn with design time values, but modified quickly thereafter) Any help on this topic is greatly appreciated. Cheers, Hans-Peter |