I'm still here...
[email protected] (Dallas Johnston)
| Newsgroups | gmane.comp.python.anygui.devel |
|---|---|
| Message-ID | <[email protected]> |
Sorry about not being as vocal as one might expect when assigning oneself to a task, namely Models.py.
I have been plugging at it, and mulling around a _few_ ideas for the implementation. I think that the easiest way is perhaps not the most aesthetically pleasing: providing some sort of special model attribute to the Model class for distinguishing purposes, or doing some nasty type-checking inside Attribs.py. (This is essential what the old code did anyway.) -- This is also why I suggested integrating the model class into attribs as a special container-like substrate under the Proxy, but behaving on it's behalf for its assigned properties.
Also, regarding the updating of the actual property in the wrapper(widget), I definitely agree with Magnus in that rawSet(..) should do just that, but perhaps the confusion stems from the fact that the code that is currently in place for rawSet is meddling with the Model again.
I've got a very simple sequence in mind that I have almost finished in the code itself, and it doesn't require the push-pull or rawSet mechanisms. This method assumes (perhaps to presumptuously?) that Proxy is satisfied with Model taking over management of Wrapper's property by essentially becoming the state's element.
widget.text = TextModel()
--> Attrib.__setattr__ ->
[If Model] {
--> TextModel.removed(getSetter(name))
-> unlink( TextModel, setter )
,
--> TextModel.assinged(getSetter(name))
-> link( TextModel, setter )
,
-> Attrib.state[name] = val
}
...
widget.text = "Hah, hah.. fooled you!"
--> Attrib.__setattr__ ->
try {
--> Attrib.state[name].setProp(val)
-> send( TextModel, val )
}
else{
--> getSetter(name)(val)
}
Only problem with this is that you run into trouble trying to delete the model from out of Proxy. Ie. 'del widget.text' would only successfully delete a temporary return from .text .
Perhaps we could clean things up a bit by offering a model-installation API? Like widget.installTextModel(TextModel()), where the handling of which can be dynamic, in that __getattr__ would parse the function name and delegate the responsibility of creating the model environment to the strata-model component that I suggested earlier??
Anyway, what do you all think?
--Dallas
__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp
Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf