Re: question

"Samuele Pedroni" <[email protected]>
Newsgroups gmane.comp.python.anygui.devel
Message-ID <015e01c2528f$5acbc5a0$6d94fea9@newmexico>
From: Joseph A. Knapka <[email protected]>
> Samuele Pedroni wrote:
> >
> > From: Joseph A. Knapka <[email protected]>
> > > Samuele Pedroni wrote:
> > > >
> > > > Yes, this stuff need some rethinking.
> > > >
> > > > For the moment I think it allows to write:
> > > >
> > > >    isDummy(self.widget.parent)
> > >
> > > But if self.widget is None, a perfectly reasonable possibility,
> >
> > but the whole point of DummyWidget is not to have that happen
>
> Yes, you're right, I did the wrong thing with noWidget()

But it isn't really your fault.

> (I wasn't familiar with the Null pattern at the time, so
> the purpose of DummyWidget was a bit mysterious to me).
> Wrapper.widget should always exist, and either be a DummyWidget
> or a native widget. But I'm not sure that invariant is
> enforced - when I first tried to make tkgui and wxgui
> work with the new API, assuming wrapper.widget exists
> caused lots of AttributeErrors. Maybe that issue is fixed
> now?

As I said a dummy object can do some good with respect to a defined protocol,
here we need something that sing and dance whatever you ask it. The problem is
that the code exploiting DummyWidget would become probably too much innocent
looking if it exploited DummyWidget to the max, now because of all the trys at
least it screams "pay attention". For the readability of the code maybe it is
better just to have

Proxy.wrapper always there and either None or a wrapper,
Wrapper.widget always and either None or a concrete widget,

the code would become more verbose so but more clear in its intent.

If it is ok I can change the core/tkgui/javagui code accordingly, otherwise I
can simply fix the DummyWidget usage and remove some trys but I don't know if
that's the best thing for the  backend writers in general.

regards.




-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
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.