/*********************************************************
 * Gotcha library example code.
 * (c)1995 Thomas Bickel. All rights reserved.
 *
 * Request a node from the user with GL_NodeRequest.
 *********************************************************/

#include <stdio.h>

#include <clib/exec_protos.h>
#include <pragmas/exec_pragmas.h>
#include <clib/gotchalib_protos.h>
#include <pragmas/gotchalib_pragmas.h>
#include <libraries/gotchalib.h>

struct Library *GotchaLibBase;
struct gl_browser gb;
UBYTE r[64];

/***********************************************************************/
int main(long argc, char *argv[])
{
	if (GotchaLibBase = OpenLibrary("gotcha.library",1)) {
		if (gb.co = GL_OpenNL("nodelist:")) {

			gb.flags	= 0;
			gb.result	= r;
			gb.wtitle	= "Select something...";
			gb.scr		= NULL;

			if (GLB_OK == GL_NodeRequest(&gb)) printf("You selected: %s\n",r);

			GL_CloseNL(gb.co);
		} else
			puts("Could not open the nodelist!");

		CloseLibrary(GotchaLibBase);
	} else
		puts("Could not open 'gotcha.library' v1 !");
}
