Re: scanf from script called by button

Chytracek Radovan (chytrace@ns.saske.sk)
Fri, 29 May 1998 07:20:08 +0200 (MET DST)


On Thu, 28 May 1998, Richard Hasty wrote:

> Date: Thu, 28 May 1998 17:08:16 -0500 (CDT)
> From: Richard Hasty <rhasty@io.com>
> To: roottalk@hpsalo.cern.ch
> Subject: scanf from script called by button
>
>
>
> Well I'm repeating myself exactly, but I'll try again.
>
> 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);
> }
>
>
>
>
Hello,

look at the

http://root.cern.ch/root/roottalk/roottalk98/0434.html

it could help to solve your problem

Happy ROOTing

Radovan

#=============================================================#
# Radovan Chytracek Slovak Academy of Sciences #
# Watsonova 47,Kosice,04001, #
# Slovak Republic #
# phone: +42 95 633 2741-2 , ext. 156 fax : +42 95 633 6292 #
#===================#=========================================#
# Linux iii is the # chytrace@saske.sk #
# best (0 0) choice # http://www.saske.sk/~chytrace #
#===ooO==U==Ooo=====#=========================================#