On Wed, 14 Dec 2011 17:08:35 -0800 (PST)
HansBKK <[email protected]> wrote:

> > Right, if you have more than on Leo open they will attack each other :-)
> >  
> If this is difficult to do within Python - I assume because it requires 
> poking into underlying OS-platform-specific stuff - then what about letting 
> OS-specific "launch wrappers" handle it? Hang on a minute. . .
> 
> OK, I've just written an AutoHotKey script to launch Leo that looks for the 
> string ".leo" in window titles and if found, pops up "are you sure?" with a 
> list of the window titles currently open.

Cool.  I don't think it's that hard to make a cross platform solution,
one approach is to have Leo write its pid (process ID) to a file in
the .leo directory, and erase it when it exits.  And check for it being
there already when it starts, of course.  VNC, GoogleEarth, Chrome,
OpenOffice, all seem to take this approach.

The added nicety would be bringing the pre-existing Leo to the front.
The approach used in the leoserver plugin is a general solution for
remote control of a running Leo, but for this particular case a
lightweight use of http://docs.python.org/library/signal.html might be
ok - it doesn't say anything about not being available in Windows.

Cheers -Terry

-- 
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