35 Int_t GetUnID(
void) {
return ++fID; }
50 virtual ~MyApplication();
53 void DoEnteredCommand();
63 Connect(
"CloseWindow()",
"MyApplication",
this,
"DoExit()");
75 fComboCmd =
new TGComboBox(fHL2,
"", fIDs.GetUnID());
81 FILE *fhist = fopen(hist.Data(),
"rt");
84 while (fgets(histline, 256, fhist)) {
85 histline[strlen(histline)-1] = 0;
86 fComboCmd->InsertEntry(histline, 0, -1);
92 gClient->GetColorByName(
"#c0c0c0", backpxl);
98 fExit->
Connect(
"Clicked()",
"MyApplication",
this,
"DoExit()");
102 SetWindowName(
"GUI with CINT Input/Output");
104 Resize(GetDefaultSize());
106 fCommand->
Connect(
"ReturnPressed()",
"MyApplication",
this,
"DoEnteredCommand()");
110 MyApplication::~MyApplication()
117 void MyApplication::DoExit()
125 void MyApplication::DoEnteredCommand()
129 const char *command = fCommand->
GetTitle();
132 if (strlen(command)) {
134 prompt = ((
TRint*)
gROOT->GetApplication())->GetPrompt();
135 FILE *cintout = fopen(fName.Data(),
"a+t");
137 fputs(
Form(
"%s%s\n",prompt.
Data(), command), cintout);
141 gROOT->ProcessLine(command);
142 fComboCmd->InsertEntry(command, 0, fIDs.GetUnID());
143 Gl_histadd((
char *)command);
145 fTextView->LoadFile(fName.Data());
146 if (fTextView->ReturnLineCount() > 10)
147 fTextView->SetVsbPosition(fTextView->ReturnLineCount());
150 printf(
"No command entered\n");
152 fTextView->ShowBottom();
157 new MyApplication(
gClient->GetRoot(),600,300);
virtual void Clear(Option_t *="")
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
virtual TGTextEntry * GetTextEntry() const
virtual const char * WorkingDirectory()
Return working directory.
virtual void SetBackground(Pixel_t p)
set background color
virtual const char * HomeDirectory(const char *userName=0)
Return the user's home directory.
virtual UInt_t GetDefaultHeight() const
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...
R__EXTERN TApplication * gApplication
virtual const char * UnixPathName(const char *unixpathname)
Convert from a Unix pathname to a local pathname.
virtual int Unlink(const char *name)
Unlink, i.e. remove, a file.
#define ClassDef(name, id)
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot...
R__EXTERN TSystem * gSystem
char * Form(const char *fmt,...)
virtual Int_t RedirectOutput(const char *name, const char *mode="a", RedirectHandle_t *h=0)
Redirect standard output (stdout, stderr) to the specified file.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
virtual const char * GetTitle() const
Returns title of object.
const char * Data() const