w. szukalski wrote:
> Does any soul know how the following:
> 
> NAME
>        XtAppAddInput, XtRemoveInput - register and remove an input source
> [..]
> can be programmed in FLTK2 ?
> 
> I suppose, I have to write:
> 
>       add_fd(fd, condition, cb, cb_args);
>       remove_fd(fd, condition);
> 
> with condition = (READ | WRITE | EXCEPT).

        Yes, that would appear to be correct.

        There is an *FLTK1* example of using add_fd() here:
        http://www.seriss.com/people/erco/fltk/#add_fd

        Although FLTK2 has slightly different syntax, the use of add_fd
        should be the same.

        Note that this is a very unix specific technique that likely
        won't work at all under Windows.

        To support both platforms well, you probably want to use
        a child thread that monitors the input stream, and passes data
        through a common buffer to the parent (fltk) thread which would
        use an FLTK timer to poll the buffer to read it, the two threads
        agreeing on when to access the buffer using simple locking.

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

Reply via email to