On Feb 16, 12:01 pm, "Edward K. Ream" <[email protected]> wrote:

> To make the 5-phase load process work, newLeoCommanderAndFrame must ensure 
> that no c.config.getX method is called from any of the methods invoked from 
> newLeoCommanderAndFrame.

> At present, there are few exceptions to this rule.  I'll handle this by 
> splitting several finishCreate methods into "init" and "finishCreate" parts.

This strategy a bit more complex than it needs to be: we can fold the
"init" part into each ctor.  The simple rule for each ctor then
becomes:

    Each ctor creates all the objects it needs.

To make *this* rule work, ctors must refrain from calling any code
that requires settings.  Such code should go into the class's
finishCreate method.  The effect of this rule will be that creating
the Commander for a new window will create *all* the objects needed by
that window.  This is, by far, the simplest thing that could possibly
work.

Phase 4 calls all finishCreate methods.  The following rule for each
finishCreate method *might* work:

    Each finishCreate method calls the finishCreate method for all
objects created in the ctor.

But this rule may be naive: order definitely matters when initing the
gui. Happily, a straightforward alternative will work.  Phase 4 can
call the finishCreate methods in the order in which they appear at the
end of g.app.newCommanderAndFrame.

Imo, this general scheme clearly can work.  In fact, it is already
partially working.  The last steps are really just debugging, albeit
with the requirement that the code is effectively unchanged when
g.new_config is False.  Recent code contains useful traces of the new,
simplified, c.config.get method.  To discover why a *particular*
setting isn't being inited in a timely manner, I need only trace
c.config.get for *that* setting, which is trivial to do by altering
the definition of the trace variable in c.config.get.

I suspect that fixing just a few traces will suffice to have Leo draw
the screen properly initially, and to have all unit tests pass.  Otoh,
an extended period of testing will be needed to verify that all
objects are created correctly.  Existing unit tests will be helpful,
but not conclusive.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to