Leo's idle-time handling is a bit of a mess.  I'm thinking of simplifying 
it by putting most of the logic in qtGui.py.  This makes sense, imo, 
because idle-time handling is inherently platform/gui dependent.  I'll do 
this regardless of the choices I am about to discuss...

I have a half memory that someone wanted g.app.afterHandler, maybe for use 
by a plugin.  However Leo's sources don't use it, and I don't see how it 
could be useful without replacing the default idle-time event handler, 
g.idleTimeHookHandler, with something else.  And I don't see how the 
default idle-time event handler can be replaced without monkey-patching the 
Leo's code, which would mean that extra flexibility of g.app.afterHandler 
would not be needed anyway.

In short, the code seems to promise more flexibility than actually exists.  
There are two ways forward:

1. Simplify the code by *always* using g.idleTimeHookHandler as the one and 
only idle-time hook.  This would be reasonable.

2. Generalize the code by having the timer callback call a user-settable 
event handler, held in g.app.afterHandler, or better, 
g.app.idleTimeEventHandler, with g.idleTimeHookHandler as the default value.

As I write this, I see that g.idleTimeHookHandler is a ridiculous name.  A 
hook is an event handler, so the name should either be g.idleTimeHook or 
g.idleTimeEventHandler.  I prefer the latter.

Your comments please.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to