
/* Generated by Interface Builder */

#import "bridge.h"
#import <appkit/TextField.h>
#import <appkit/Form.h>
#import <appkit/Text.h>
#import <appkit/FormCell.h>
#import <appkit/Application.h>
#import <string.h>

id bridgeObj;  /* object instance */
char *user_in;

void NeXT_prompt(char *out, char *response)
{
  [bridgeObj outPrompt:out];
  strncpy(response,user_in,60);  
}

void NeXT_unprompt()
{
  [bridgeObj unprompt];
}

@implementation bridge

- outPrompt:(char *)out
{
  [showPrompt setTitleWidth:-1.0];
  [showPrompt setTitle:out];
  [responsePanel makeKeyAndOrderFront:self];
  [responseLine selectTextAt:0];
  [responseLine setStringValue:NULL at:0];
  [responsePanel makeKeyAndOrderFront:self];
  [NXApp runModalFor:responsePanel];
  return self;
}

- endResponse:sender
{
  [responseLine selectTextAt:0];
   user_in = [responseLine stringValueAt:0];
  [NXApp stopModal];
  [self unprompt];
  return self;
}

- unprompt
{
  [responsePanel orderOut:self];
  return self;
}

- doquery:sender
{
  [queryForm selectTextAt:0];
  old_menu([queryForm stringValueAt:0]);
  return self;
}

- init
{ extern char *VERSION;
  [super init];
  [setVersion selectTextAt:0];
  [setVersion setStringValue:VERSION];
  bridgeObj = self;
  printf("Bridge init\n");
  return self;
}

- iterate:sender
{   old_menu("g");
    return self;
}

- refine:sender
{  old_menu("r");
   return self;
}

- quit:sender
{
   old_menu("q");
 return self;
}


@end
