Re: Displaying html help file
- From: Paul Davis <pbd Op Net>
- To: "Abhinaba Basu" <basuabhinaba yahoo com>
- Cc: "Gtk-List Gnome Org" <gtk-list gnome org>
- Subject: Re: Displaying html help file
- Date: Wed, 02 May 2001 08:34:53 -0400
>I want to display help file in html format when the user clicks on a button
>by calling the default browser.
there is no "default" browser.
to do this with netscape, you need something like this:
int
whatever (char *url)
{
char buf[PATH_MAX+16];
char *argv[4];
int grandchild;
if (fork() == 0) {
/* child */
if ((grandchild = fork()) == 0) {
/* grandchild */
argv[0] = "netscape";
argv[1] = "--remote";
g_snprintf (buf, sizeof(buf)-1,"openFile(%s)", url);
argv[2] = buf;
argv[3] = 0;
execvp ("netscape", argv);
cerr << "could not start netscape" << endl;
_exit (1);
} else {
int status;
waitpid (grandchild, &status, 0);
_exit (0);
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]