> Sorry for my unclear description, it was two independent 
> executables. Can window manager control the focus on each 
> application? If so, how to control? Thanks.

Ah, that is unfortunate - that is certainly the hard way to do this,
then.

There's no really standard way to manage the focus between independent
applications - what works can vary on differing window managers, and
certainly varies between systems...

If the two executables know each others process ID's or window ID's, it
might be possible for them to communicate, and to tell the WM to set the
focus to the right window. 
But I don't much fancy that approach...

Or you could, as Greg suggests, use IPC (either by socket or pipe) to
pass events and keyboard data between the executables, thus producing
the desired effect - but again that is tricky.


Does it *really* need to be two executables? If it were only one
executable, but with two independent threads of execution, things would
be much easier - the two windows would then be in the same process space
and forcing the focus onto the right window, using standard fltk
functions, would be trivial.

A variation on that idea is to actually have 3 executables - one for
each of your two existing "worker" processes (modified to have no GUI of
their own) and one for a combined GUI that serves either or both of the
existing processes - again, since the two GUI windows would be in the
same process, managing the focus between them becomes straightforward.
I have used this approach in the past, and it worked OK, but
communication between the "worker" processes and the GUI process was a
bit tricky...
It did have the advantage that distributing the worker processes over
the network became easy (as they communicated with the GUI process using
sockets for their IPC layer.)




SELEX Galileo Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
3EL
A company registered in England & Wales.  Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to