On 07/16/11 00:42, Carlos Luna wrote:
> 
> Ok, here“s some example code showing the situation.

        I'd suggest trying a few things.

        First: Try adding some fopen() calls to test if you can
        access the files with normal operating system calls using
        the same filenames you're passing to Fl_PNG_Image for the
        situations where you are encountering problems, eg:

Fl_PNG_Image imagen("mas.png");
Fl_PNG_Image imagen2("Gentoo-small.png");
/// ADD THE FOLLOWING. *be sure to #include <FL/fl_ask.H>*
FILE *fp;
if ( ( fp = fopen("mas.png","r") ) == NULL ) { fl_alert("mas.png"); exit(1); } 
else { fclose(fp); }
if ( ( fp = fopen("Gentoo-small.png","r") ) == NULL ) { 
fl_alert("Gentoo-small.png"); exit(1); } else { fclose(fp); }

        See if you get any alerts. If so, that's probably
        the issue; the relative filenames are not resolving
        due to the current working directory not being what
        you expect.

        If you /don't/ get any alerts, then the FLTK folks might
        need to look into this further, in which case as you say,
        it might be a problem in the lib.

        ALSO: perhaps it's no longer needed, but I thought FLTK apps
        that used the FLTK image library had to call:

fl_register_images();

        ..at the top of main() to ensure the lib properly initialized.
        So you should try adding that as the first thing in your main().
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to