On Tue, Jun 15, 2010 at 2:53 AM, Nick_H <[email protected]> wrote:
> Edward,
>
> Many thanks for that help. I see the calls in qtGui.py (I'm not using
> Tk).
> I'll go play.

Rev 3121 of the trunk contains support (Qt gui only) for activate and
deactivate events.

Here is a test script in test.leo:

import leo.core.leoPlugins as leoPlugins

def on_deactivate(tag,keys):
    c = keys.get('c')
    g.trace(c)

def on_activate(tag,keys):
    c = keys.get('c',keys)
    g.trace(c)

leoPlugins.registerHandler("deactivate", on_deactivate)
leoPlugins.registerHandler("activate", on_activate)

print('window events activated')

After executing this script with the execute-script command, you will
see events.  Note that the tag will be 'body' for activate events and
'tree' for deactivate events.  I don't remember why I did it this way,
but such hacks are often necessary when dealing with situations that
in fact generate multiple events.

Let me know if this works for you.  If not, we can try other ways of
generating activate/deactivate events.

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