> leowang wrote: > > The two window are not in one process. > > Yikes, then you're basically trying to do two tricky things: > > * Undermine the window manager behavior for focus of events > * Allow events to cross processes > > Not impossible, but might be hard if you're not familiar with > interprocess communication. > > You would probably have to do a bit of custom work to first move > the events from one process to the other, then shove them into > the widget you want via the handle() method. > > Certainly with a TCP connection you can move data between the > two processes, having all numeric keypad events trapped by > "process B", and send the the chars over TCP to "process A", which can > then attempt to insert the characters into the widget in question, > eg. your_input_widget->append(char) [or whatever the method would be > for your widget to append characters to it]. > > With TCP you can bind() to the 127.0.0.1 interface to prevent the > possibility of someone on another machine attempting to connect to > the local machine. > > Doing this might limit the number of instances of your program > one can run on a machine, since if there are many "process A" > and "Process B"'s, it might hard to determine which processes > need to be paired, unless "process B" knows "process A"'s PID.. > > If "process A" started "process B", then at least "A" can > possibly pass in its PID or "listening TCP port" to "B", > so that "B" can know how to contact A. > > There's other techniques for IPC besides TCP; unix domain sockets > and pipes are two options, both a bit of systems programming is > involved. > > Anyway, tricky stuff.
Thanks for your defatil reply, I will try to follow your way to have a try. Maybe need more time. :( _______________________________________________ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk