fix image loading

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@241 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1997-12-02 05:38:05 +00:00
parent 53163194b3
commit e605c00283

View File

@ -188,6 +188,7 @@ char *htmlRead( char *file );
#if USE_XMHTML
void xaccJumpToLabel (Widget mw, char *jumpfile);
XmImageInfo * htmlReadImageProc (Widget w, String file);
#endif
#if HAVE_XPM
@ -275,6 +276,7 @@ helpWindow( Widget parent, char *title, char *htmlfile )
#if USE_XMHTML
xmHTMLWidgetClass, controlform,
XmNanchorButtons, False,
XmNimageProc, htmlReadImageProc,
#endif
XmNtopAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_FORM,
@ -560,7 +562,11 @@ htmlRead( char *file )
int size=0;
int fd;
sprintf( (char *)&filename, "%s/%s", helpPath, file );
/* construct absolute path */
strcpy (filename, helpPath);
strcat (filename, "/");
strcat (filename, file);
/* Open file: */
fd = open( filename, O_RDONLY );
if( fd == -1 )
@ -590,6 +596,31 @@ htmlRead( char *file )
}
/********************************************************************\
* htmlReadImageProc *
* *
* Args: file - the name of the html file to read *
* Return: none *
* Global: helpPath - the path to the help files *
\********************************************************************/
#if USE_XMHTML
XmImageInfo *
htmlReadImageProc (Widget w, String file)
{
char filename[BUFSIZE];
XmImageInfo *retval;
/* construct absolute path -- twiddle teh relative path we recieved */
strcpy (filename, helpPath);
strcat (filename, "/");
strcat (filename, file);
/* use the default proc for the hard work */
retval = XmHTMLImageDefaultProc(w, filename, NULL, 0);
return retval;
}
#endif /* USE_XMHTML */
#if HAVE_XPM
/********************************************************************\
* htmlResolveImage *