With all the recent excitement about hard crashers, it would be easy
to overlook the real progress that has been made recently.

The main features of the new code are:

1. Drawing the tree happens immediately.  There is no difference
between c.redraw() and c.redraw_now().

2. c.redraw now takes an optional 'p' argument.  A typical call is
c.redraw(p).  This eliminates the potential for errors.  In the old
way, you would write something like:

    c.selectPosition(p)
    c.redraw()

This pattern was bad design.  In the new world, c.redraw ensures that
surprisingly complex constraints involved in selecting and redrawing
nodes are handled properly and uniformly.

3. Most importantly, Leo's core now supplies simple and effective
optimization hint to the gui redraw code.  As we see, this allows the
qt gui to work at maximum possible speed.

The added information provided by Leo's core to the gui plugins is
better than I ever dreamed possible:

- It is clear. The hints are supplied by the c.redraw_after_x methods.

- It is easy to use. The qt plugin needs no AI to determine how to
optimize screen redraws.

- It is effective. Full redraws are reduced to near an absolute
minimum.

In conclusion, the new code is well worth whatever temporary troubles
we have experienced recently.

Edward

P.S. Still to do: optimize redraw_after_icons_changed in the tk
plugin.  However, the unoptimized tk code draws the screen about 10%
faster than the qt code.  This shows not only how fast tk is, but how
much work I put into optimizing Leo's tk tree code.

P.P.S.  As Kent's @auto code shows, immediate redraw can cause
problems.  I solved the @auto bug by ensuring that the importers in
leoImport.py don't call c.redraw_after_icons_changed "by accident". An
alternative would be to re-introduce the c.begin/endUpdate pattern.

I just realized why I have been resisting this old pattern: it makes
it difficult to retain drawing optimizations.  That is, c.endUpdate
has little choice but to do a full redraw.  So in spite of the
potential for occasional bugs, I'd like to live in the optimized
redraw world at all times.

EKR
--~--~---------~--~----~------------~-------~--~----~
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