Reposting the OP's code reformatted.

OP, why would you be specifying anything other than
the absolute path to the image?

You surely can't make assumptions about the current
working directory being set to anything in particular
unless you force it to be something specific with chdir().

---- snip

#include <stdio.h>
#include <string.h>
#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
//#include <FL/Fl_Scroll.H>
#include <FL/Fl_PNG_Image.H>
// Test the Fl_OpDesk widget
#include "Fl_OpDesk.H"
#include "Fl_OpBox.H"
#include "Fl_OpButton.H"
int main() {
        // If I specify the whole path for each image, everything works ok
        Fl_PNG_Image 
imagen("D:\\Tzarls\\Cpp\\Fl_OpDesk\\Fl_OpDesk\\Release\\mas.png");
        Fl_PNG_Image 
imagen2("D:\\Tzarls\\Cpp\\Fl_OpDesk\\Fl_OpDesk\\Release\\Gentoo-small.png");

        // Comment out previous lines and uncomment these two lines; app won´t 
work anymore,
        // (unless you change the .exe file and the images to a folder with a 
shorter path name)
        //Fl_PNG_Image imagen("mas.png");
        //Fl_PNG_Image imagen2("Gentoo-small.png");
        Fl_Double_Window *win = new Fl_Double_Window(720,486);
        // ... but if you comment all previous 4 Fl_PNG_Image lines and 
uncomment these two,
        // effectively placing them after the double window, it works again.
        //Fl_PNG_Image imagen("mas.png");
        //Fl_PNG_Image imagen2("Gentoo-small.png");
        Fl_Group *g = new Fl_Group(10,10,win->w()-20,win->h()-20);
        g->box(FL_DOWN_BOX);
        const int deskw = 1500;
        const int deskh = 1500;
        // This is a class of mine (actually, a class made by Greg Ercolano).
        // Weird thing is that, if I remove
        //the following line, then the app will work ok no matter which one
        // of the previous options you choose...
        Fl_OpDesk *opdesk = new Fl_OpDesk(g->x() + 2,g->y() + 
2,g->w()-4,g->h()-4);
        // Yes, you could say that the problem is inside the Fl_OpDesk class,
        // but if that was the case,
        // then why by just changing the folder of a non-working version
        // of the app it would start working again?
        // BTW, every option works perfectly when running the debug app.
        // The problem appears only for releases.
        g->end();
        win->resizable(g);
        Fl::scheme("gtk+");
        win->show();
        return(Fl::run());
}
---- snip
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to