RE: Displaying html help file



Question:

When you fork from within a thread (ie, there are x number of other threads
running in you process), do you 1 or x + 1 threads running in the new
process?

-Michael

-----Original Message-----
From: Paul Davis [mailto:pbd Op Net]
Sent: Wednesday, May 02, 2001 8:35 AM
To: Abhinaba Basu
Cc: Gtk-List Gnome  Org
Subject: Re: Displaying html help file 


>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);
		}

	} 
}

_______________________________________________
gtk-list mailing list
gtk-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]