Input to script called from button (fwd)

From: Richard Hasty (rhasty@io.com)
Date: Fri May 22 1998 - 18:42:56 MEST


Hi,

I'm trying to write some simple scripts that can be called using a button,
but the scripts need some input. The scripts below illustrate the problem. 
THe read and print script works perfectly when called with ".x
readtest.c", but when called from a button the string is not printed as
the user types, even though it seems to read the correct string.  The
feedback is rather important while you are typing.  I'm using version
2.00/07.  Do you know of a way around this problem? 

Thanks,
Richard Hasty
rhasty@io.com

buttontest.c

{
//Set up a button

//   gROOT->Reset("a");
   bar = new TControlBar("vertical", "SAMPLE");
   bar->AddButton("Read",     ".x readtest.c", "Read text");
   bar->Show();
//   gROOT->SaveContext();
}


readtest.c:

{
char test[80];

fprintf(stdout,"Read Junk:");
fscanf(stdin,"%s",test);
fprintf(stdout,"%s\n",test);
}



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:33 MET