Hi!
If the `Fl_Help_View' object has `IMG' tag, then
image can to doesn't be display if `SRC' contains
not full path to image...
I have some an offering:
In to `Fl_Help_View.cxx' necessary do to add simple function (in beginning of
file):
+++++++++++++source code begin+++++++++++++++
static bool MyRealPath(const char *nameFile, char* &pathOut){
if(nameFile == NULL){ return false; }
if(strlen(nameFile) < 1){ return false; }
bool ret = false;
char *rpath = NULL;
// for Windows
#ifdef _WIN32
rpath = new char[MAX_PATH+1];
if(rpath != NULL){
if( GetFullPathName(nameFile, MAX_PATH, rpath, NULL) > 0 ){
if(pathOut != NULL){ delete[] pathOut; pathOut = NULL; }
pathOut = new char[strlen(rpath)+1];
if(pathOut != NULL){
strcpy(pathOut, rpath);
ret = true;
}
}
delete[] rpath; rpath = NULL;
}
// for Linux
#else
rpath = realpath(nameFile, NULL);
if(rpath != NULL){
if(pathOut != NULL){ delete[] pathOut; pathOut = NULL; }
pathOut = new char[strlen(rpath)+1];
if(pathOut != NULL){
strcpy(pathOut, rpath);
ret = true;
}
free(rpath); rpath = NULL;
}
#endif
return ret;
} /// end function `RealPath'
+++++++++++++source code end+++++++++++++++
And on line 860 instead `img = get_image(attr, width, height);'
need to put:
+++++++++++++source code begin+++++++++++++++
char *n_path_to_img = NULL;
if(MyRealPath(attr, n_path_to_img )){
img = get_image(n_path_to_img, width, height);
}
else { img = get_image(attr, width, height); }
if(n_path_to_img != NULL){ delete[] n_path_to_img; n_path_to_img = NULL; }
+++++++++++++source code end+++++++++++++++
Regards.
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev