First: thank you!
> I think Serhiy has done a very good job ...
I'm not saying he ain't! More so, I greatly appreciate everyone's time and effort. But I'm discussing the implementation here, not somebody's work.
Apparently I haven't been precise enough in conveying my message. Let me try to clarify what I mean. Consider the following:
An object gets initialized. The object's constructor accepts a "master" optional parameter (e.g. Variable.__init__). So, every time:
-- "master" is None
and
-- _support_default_root is True
a default root must be instantiated. A master is optional, and when it's not given and _support_default_root switch is on, a default root should be supplied. That's the whole point of _support_default_root after all.
My understanding of the module is not as deep as yours', but getboolean(), mainloop() and image_types() shouldn't be affected.
"Too early to create image: no default root window": Why isn't there? When _support_default_root is on.
Again, I can see that:
> "no default root window" is correct
:But why is there no default window? Support default root is on, right?
> There is no yet default root window required by the function.
:A default root is required when you instantiate an Image without a "master". It's not required as an argument, but it is required for the operation of Image.
I'm suggesting something like:
> class Variable:
> ...
> def __init__(self, master=None, value=None, name=None):
> ...
> master = master or _get_default_root()
> self._root = master._root()
> ...
> class Image:
> ...
> def __init__(self, imgtype, name=None, cnf={}, master=None, **kw):
> ...
> master = master or _get_default_root()
> self.tk = getattr(master, 'tk', master)
> ...
Best Wishes
Ivo Shipkaliev |