> [email protected] wrote:
> >> [email protected] wrote:
> >>> I've been using FLTK to wrapper very complex engineering calculations..
>
>       But if you're using Windows, don't use the above two approaches.
>       The best way to go is create a thread to handle the popen()+read+close,
>       and have the main thread to watch for data as it comes in using
>       either the Fl::check() approach to poll for new data, or create
>       an Fl::add_timeout() that watches for data 4 or 5 times per second.
>       I don't have an example for that ATM, but if I find some time,
>       I can maybe supply one.

   So far, I've been pretty diligent about making my applications 
cross-platform compatible -- in this case, these are physics calculations that 
run only under Linux (but could be made to run under Windows).

Are we sure about add_fd in Windows?  Windows supports _popen() which is the 
same as Linux popen(); I use these directives:
#ifdef WIN32
        #include <Windows.h>
        #include <Commdlg.h>
        #include <direct.h>
        #define popen _popen
        #define pclose _pclose
        #define fl_message(a) MessageBox(0, a, "Message", 0)
        inline char* dirname(char *a) {int i; for(i=strlen(a); i>0; i--) {if 
(a[i] == '\\') break;} a[i]=NULL; return a;}
        #define getcwd _getcwd
        #define rint(a) ((float) ((int) (a) + .5))
#else
..
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to