Path: utzoo!utgpu!watmath!clyde!att!pacbell!ames!decwrl!sun!pepper!cmcmanis
From: cmcmanis%pepper@Sun.COM (Chuck McManis)
Newsgroups: comp.sys.amiga.tech
Subject: Re: problems with forkv (lattice)
Message-ID: <79233@sun.uucp>
Date: 29 Nov 88 17:40:47 GMT
References:  <167@fishpond.UUCP> 
Sender: news@sun.uucp
Reply-To: cmcmanis@sun.UUCP (Chuck McManis)
Organization: Sun Microsystems, Mountain View
Lines: 48

In article  (Miles Bader) writes:
>So my question (why doesn't forkv work?) still stands...
>-Miles

The following source (which is from my Life program) works fine :

/*
 * Function NewColors()
 *
 * Using Carolyn's Pallette requester this lets the user change the colors
 * around, later you can save them with the Save Defaults menu option.
 *
 * The interesting thing about this routine is that it uses a separate
 * program (Palette) to set the colors on the screen. It uses the Lattice
 * routine forkv() to start it up, the program itself opens a window on
 * the frontmost screen (the life screen) and lets the user twiddle the
 * colors. Note that I do not go back to the main event loop so you can't
 * continue to add cells etc.
 */

static char *palette_argv[] = {"Palette", NULL};	/* Program's argv[] */

NewColors(opt, f)

int opt;
{
    struct ProcID child;
    ULONG l;

    l = Lock("Palette", ACCESS_READ);
    if (l)
    {
	/* default environment */	
	forkv(palette_argv[0], palette_argv, NULL, &child);
	if (wait(&child))
	    DisplayBeep(MyScreen);	/* if they click
					   'cancel' */
	UnLock(l);
    } else {
	ShowWarning("Couldn't find the Palette program.", "OK", NULL);
    }
    return (TRUE);
}


--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.