[Edu-sig] Re: Pygeo, platforms, wx and Tk
Arthur
ajsiegel at optonline.net
Sun Dec 19 01:32:49 CET 2004
On Sat, 2004-12-18 at 15:56 -0800, Scott David Daniels wrote:
> Arthur wrote:
> > ... to get my bi-directional communication, all I need to do is
> > setattr(Display,"control_panel",self) in the __init__ of the Tk ControlPanel
> > class, so that now Display has a reference to the ControlPanel by which
> > it can send messages of its events back in that direction.
> >
> > My first ever use of setattr. Knew it was there for something ;)
>
> Hmmm.... Outside of playing with setattr, why not use:
>
> Display.control_panel = self
Because then the solution to my Big Problem looks *too* simple ;)
Interesting, relative to our prior exchange, that I needed to get some
handle on the potential next-level-down solutions, before the obvious
at-this-level solution dawned on me.
Recently had explored what is involved in deepcopying a relatively
complex class, before I realized that the actual solution to my actual
problem needed no such hairy mechanism.
Part of the problem of being half-smart when it comes to these things,
is never being sure at what level the solution to my problem lies - the
level at which I work comfortably or at a more occult (to me) level.
On the other hand I am sometimes forced into some ingenuity in the use
of what I *do* know, and feel I sometimes end up with something that
avoids being more occult than necessary - whereas someone more
comfortable at those levels may have immediately jumped there for a
solution.
Or not.
Art
More information about the Edu-sig
mailing list