Re: Model redesign?
Magnus Lie Hetland <[email protected]>
| Newsgroups | gmane.comp.python.anygui.devel |
|---|---|
| Message-ID | <[email protected]> |
Samuele Pedroni <[email protected]>: > > > From: Magnus Lie Hetland <[email protected]> > > Samuele Pedroni <[email protected]>: > > [snip] > > > > >>> btn = Button() > > > > >>> mdl = NumberModel(name='x') > > > > >>> link(mdl, btn.set) > > > > > > > > Here, when mdl is modified, btn.set will be called. To implement the > > > > controller part of things, Components can be observable as well: > > > > > > but you probably want to be able to bind an > > > non-through-ui-modifiable model to more than one components, > > > > Yes? link() can do many-to-many links, so this shouldn't be a problem, > > I think (unless I misunderstood you). > > the problem is the name above: > > a number model mdl can control comp1.foo and comp2.bar. Oh, right. Hm... I guess something like link(mdl, btn.setX) would be an alternative... Or link(mdl, btn, name='x') Hm... -- Magnus Lie Hetland Practical Python The Anygui Project http://hetland.org http://ppython.com http://anygui.org ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf