stdin doesn't display

From: eppstein@draught.caltech.edu
Date: Thu May 14 1998 - 11:52:16 MEST


I have a button that lauches a macro. This macro takes command line input
from the user. Everything works fine except that the stdin stream doesn't
echo on the command line as I type. I'm pretty sure this is because the
TDialogWindow has some sort of focus. It's not the end of the world but
it is annoying. Any Suggestions???

Thanks,
Chris

P.S. Here's my code in case your curious:

The Dialog:
{
Int_t runnum;
FILE *runfile=fopen("/home/sample/replay/root/c_run.dat","r");
char *runstr=new char[25];
fscanf(runfile,"%d",&runnum);
fclose(runfile);
sprintf(runstr,"Current Run is: %d",runnum);
TDialogCanvas *runw=new TDialogCanvas("runwindow","Current Run
Information",300,50);
TButton *runb=new TButton("Change Run",".X changerun.C(runt)",0,0,1,.5);
TPaveText *runt=new TPaveText(0,.5,1,1);
runt->AddText(runstr);
runt->Draw();
runb->Draw();
runw->SetEditable(kIsNotEditable);
runw->cd();
runb->cd();
}


The Button's Macro:

void changerun(TPaveText *r)
{
gROOT->Reset();
Int_t runnum;
char *runstr=new char[25];
printf("\nPlease enter the four digit run #: ");
do {
    fscanf(stdin," %d",&runnum);
} while (!((runnum>999)&&(runnum<10000)));
sprintf(runstr,"Current Run is: %d",runnum);
r->Clear();
r->AddText(runstr);
}

...... ..... .... ... .. .  .   .    .     .      .       .        .
Christopher M. Eppstein   Lloyd 215
MSC #492                  626.395.1387
Caltech
Pasadena, Ca 91126-0492
http://www.ugcs.caltech.edu/~eppstein/home/home.html
...... ..... .... ... .. .  .   .    .     .      .       .        .    



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