#include <TOS.H>

int main(int, char *[]);

short ap_id;
VDI_Workstation ws;		/* See entry for V_Opnvwk() in VDI docs */

char menu_title[] = "  Skeleton";

int
main(int argc, char *argv[])
{
	char *altNoVDIWork = "[3][GEM is unable to|allocate a workstation.|The program must abort.][ OK ]";
	short ret,msg[8],kc,dum;

	ap_id = appl_init();
	if(ap_id == -1)
		return -1;

	if(!OpenVwork(&ws))
	{
		form_alert(1, altNoVDIWork);
		appl_exit();
		return -1;
	}

	menu_id = menu_register(ap_id, menu_title );	/* Place name on menu bar */

	for(;;)
	{
		evnt_mesag(msg);

		switch( msg[0] )
		{
			case AC_OPEN:
				if(msg[3] == menu_id)
					OpenAccessoryWindow();
				break;
			case AC_CLOSE:
				if(msg[3] == menu_id)
				{
					v_clsvwk(ws.handle);
					break;
				}
		}
	}
}
