Edward, Many thanks for that help. I see the calls in qtGui.py (I'm not using Tk). I'll go play.
Nick On Jun 14, 4:35 pm, "Edward K. Ream" <[email protected]> wrote: > On Fri, Jun 11, 2010 at 5:55 AM, Nick_H <[email protected]> wrote: > > I'm wondering if it might be possible to hook into GotFocus/LostFocus > > or Activate/Deactivate events for the Leo window, so that with @shadow > > or @thin nodes, it would be possible to save these files when > > switching away from Leo, and refresh the outline from these files when > > switching back to Leo? > > I'm not sure this is a great idea, but let's deal with your first > question first. > > It certainly is possible with the Qt gui. The eventFilter method in > qtGui.py calls on the onActivateEvent and onDeactivateEvent methods > when focus changes. > > As noted in the comments in these methods, these methods may be called > several times, so some care may be needed. As always, window events > are some of the trickiest events to handle because various platforms > generate these events in subtly different ways. > > At present, there are no event handlers defined for these events, so > the easiest way to do what you want is to have a plugin monkey-patch > these methods. > > Presumably, something could also be done for the Tk gui, but I'll > investigate further only if you are using Tk. > > 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.
