On Oct 20, 11:55 am, "Edward K. Ream" <[EMAIL PROTECTED]> wrote:

> This is probably all for today.  I'll rewrite the tree code tomorrow.

Well, I got excited and put in the new hints into Leo's core.  All
unit tests pass, and pylint is happy.

The commander now has methods such as:

def redraw_after_icons_changed(self):
    return self.frame.tree.redraw_after_icons_changed()

In leoTkinterTree this is just equivalent to redraw.  Here is the
complete list.

redraw_after_icons_changed  = redraw
redraw_after_clone          = redraw
redraw_after_contract       = redraw
redraw_after_delete         = redraw
redraw_after_expand         = redraw
redraw_after_insert         = redraw
redraw_after_move_down      = redraw
redraw_after_move_left      = redraw
redraw_after_move_right     = redraw
redraw_after_move_up        = redraw
redraw_after_select         = redraw

This is a preliminary list.  It will probably suffice for all the
important optimizations.

Surprising many calls to redraw got converted to
redraw_after_icons_changed, which merely updates icons in the tree.
But the rest of these "hint" methods are going to be non-trivial.
When in doubt, I left the call to c.redraw intact, which is a request
(demand) that the entire tree be updated.  This will likely be done by
drawing only the visible widgets, in which case
tree.redraw_after_expand has got some real work to do.

There is one place where the original code was redraw_now instead of
redraw: I followed the hint with c.outerUpdate, so the old and new
code should be precisely identical.

Tomorrow the real work begins.

Edward

P.S. I fixed a failed unit tests that was complaining that insert-
headline was drawing the screen twice, and it was.  This must be a
recent change, though I have no memory of it.  Oh well, there will be
plenty more hacks to come :-)

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