Leo's web site now has this to say about redrawing the screen:

QQQ
You can use c.redraw_now to redraw the entire screen immediately:

c.redraw_now()

However, it is usually better to request a redraw to be done later as
follows:

c.redraw()

Leo actually redraws the screen in c.outerUpdate, provided that a
redraw has been requested. Leo will call c.outerUpdate at the end of
each script, event handler and Leo command.

The old (deprecated) way to redraw the screen was with the following
pattern:

c.beginUpdate()
try:
    << whatever >>
finally:
    c.endUpdate()

This pattern is no longer useful: as of Leo 4.5 b2, c.beginUpdate()
does nothing, c.endUpdate() is equivalent to c.redraw(), and
c.endUpdate(False) does nothing.
QQQ

The old drawing model was based on *suppressing* redraws, then
*requiring* that a redraw happen.

The new model is based on *requesting* redraws.  Most redraws happen
automatically at end of scripts, event handlers and commands.

This concludes the new redrawing project, unless bugs are found. I
think it has been well worth the effort involved:

1. The new model is much simpler conceptually.  It was literally
impossible for me to understand just how focus got set.  In contrast,
focus changes always happen c.outerUpdate, and no baroque logic is
required.

2. The new model saves a lot of typing.  In particular, unitTest.leo
no longer contains any Leo-specific cruft that must appear in @test
nodes.  This encourages more unit tests, an important long-term goal.

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