mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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:
parent
53163194b3
commit
e605c00283
@ -188,6 +188,7 @@ char *htmlRead( char *file );
|
|||||||
|
|
||||||
#if USE_XMHTML
|
#if USE_XMHTML
|
||||||
void xaccJumpToLabel (Widget mw, char *jumpfile);
|
void xaccJumpToLabel (Widget mw, char *jumpfile);
|
||||||
|
XmImageInfo * htmlReadImageProc (Widget w, String file);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_XPM
|
#if HAVE_XPM
|
||||||
@ -275,6 +276,7 @@ helpWindow( Widget parent, char *title, char *htmlfile )
|
|||||||
#if USE_XMHTML
|
#if USE_XMHTML
|
||||||
xmHTMLWidgetClass, controlform,
|
xmHTMLWidgetClass, controlform,
|
||||||
XmNanchorButtons, False,
|
XmNanchorButtons, False,
|
||||||
|
XmNimageProc, htmlReadImageProc,
|
||||||
#endif
|
#endif
|
||||||
XmNtopAttachment, XmATTACH_FORM,
|
XmNtopAttachment, XmATTACH_FORM,
|
||||||
XmNbottomAttachment, XmATTACH_FORM,
|
XmNbottomAttachment, XmATTACH_FORM,
|
||||||
@ -560,7 +562,11 @@ htmlRead( char *file )
|
|||||||
int size=0;
|
int size=0;
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
sprintf( (char *)&filename, "%s/%s", helpPath, file );
|
/* construct absolute path */
|
||||||
|
strcpy (filename, helpPath);
|
||||||
|
strcat (filename, "/");
|
||||||
|
strcat (filename, file);
|
||||||
|
|
||||||
/* Open file: */
|
/* Open file: */
|
||||||
fd = open( filename, O_RDONLY );
|
fd = open( filename, O_RDONLY );
|
||||||
if( fd == -1 )
|
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
|
#if HAVE_XPM
|
||||||
/********************************************************************\
|
/********************************************************************\
|
||||||
* htmlResolveImage *
|
* htmlResolveImage *
|
||||||
|
Loading…
Reference in New Issue
Block a user