/*

This is a simple little program(?) which demonstrates the use of
get_fname().  It is fairly self-explanatory, and was included to
give you an easy way to try my file requester.

This file should be linked with "requester.o", "requester2.o", and "r.o".
Within this archive is the executable version of this program, entitled
"demo".

Rick
*/

#include <intuition/intuition.h>
#include <functions.h>

struct NewScreen NewScreen = 
	{
	0,0,640,200,4,0,1,HIRES,WBENCHSCREEN,NULL,NULL,NULL,NULL,
	};

struct NewWindow NewWindow =
	{
	40,20,200,100,0,1,MENUPICK | NEWSIZE | GADGETUP | MOUSEBUTTONS |
	GADGETDOWN | MOUSEMOVE,WINDOWCLOSE | SIMPLE_REFRESH | WINDOWSIZING | 
	WINDOWDEPTH | WINDOWDRAG | ACTIVATE | GIMMEZEROZERO,NULL,NULL,NULL,
	NULL,NULL,20,20,300,120,CUSTOMSCREEN,
	};

struct IntuitionBase *IntuitionBase;

main()
	{
	struct Screen *Screen;
	struct Window *Window;
	char file_name[200];
	char dir[200];
	char *get_fname();
	char *result;

/* Open Intuition Library */
	IntuitionBase = (struct IntuitionBase *)
					OpenLibrary("intuition.library",NULL);
/* Open screen */
	Screen = OpenScreen(&NewScreen);
	NewWindow.Screen = Screen;
/* Open window */
	Window = OpenWindow(&NewWindow);
/* Copy initial strings into buffers */
	strcpy(file_name,"test_name");
	strcpy(dir,"df1:");
/* Call THE function */
	result = get_fname(Window,Screen,"Test File Requester",file_name,dir);
/* Print resulting path list or "NULL" if canceled */
	if(result)
		printf("%s\n",result);
	else
		printf("NULL\n");
/* Clean up */
	CloseWindow(Window);
	CloseScreen(Screen);
	CloseLibrary(IntuitionBase);
	}
