Re: Q: wrappers push/pull and models

Magnus Lie Hetland <[email protected]>
Newsgroups gmane.comp.python.anygui.devel
Message-ID <[email protected]>
Samuele Pedroni <[email protected]>:
>
> Hi.
> 
> Are models already supported by current design vs. implementation?
> 
> Checking the pull/push counts I noticed that e.g.
> 
> comp.visible = 1
> 
> (if the widget is there) will first pull visible and then push the
> new value.
> 
> The pull visible logic seems there to deal with models
> (Attrib.rawSet). It seems (me skimming the code) that models will be
> pushed down to wrappers and be expected to be returned form wrappers
> by pull.

Hm... Tricky.

> Are really wrappers expected to be able to deal with models
> vs. plain values?

Not really; for setters, it would be nice if this worked -- the models
should be polymorphically equivalent to the primitives (and the
wrapper should take care of conversions) and pull should use in-place
modification anyway, so it doesn't matter if the value returned from
the wrapper is a primitive value rather than a model.

I think it should be possible to make this work... :]

> Or should models be dealt and live only at the proxy level, with
> push and pull with/from wrappers only dealing with values and eager
> changes being managed through events?

Eager changes should be managed only through events, yes. The model
behaviour is *not* dealt with by the wrappers. The wrappers should
*not* modify the objects they are passed from the proxy.

> Thanks.

-- 
Magnus Lie Hetland                                  The Anygui Project
http://hetland.org                                  http://anygui.org


-------------------------------------------------------
In remembrance
www.osdn.com/911/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.