I would like to follow up on yesterday's posting. I tried a second method as documented in TExec. c1->AddExec("ex", ".x exec.C"); ---------- AFter I get into a Canvas, I press the key 'n'. The Root prints out event # = 24 px = 110 py = 0 ----------------- (1) Why are there two different behaviors? i.e. TExec ex() and ex.Draw() don't work. But c1.AddExec works. (2) In today's method, when I press a Cursor_Up key, the print out is event # = 24 px = 0 py = 0 How should I do in order to obtain a non-zero px value when Cursor_Up key is pressed??? ------------------ HP >Machine: Sun Solaris >ROOT/Cint: 5.25.03 / 5.14.49 >Built with g++ > >I have a macro file called exec.C as shown in the following: >{ > int event = gPad->GetEvent(); > cout << "event # = " << event << endl; > cout << "px = " << gPad->GetEventX() << " py = " << gPad->GetEventY() << endl; >} > >I open a Canvas (c1) with a histogram in it. > >Now I do: >TExec ex("ex", ".x exec.C"); >ex.Draw(); > >--------------------- >I put the mouse in the pad and click the left button. >The ROOT window shows >event # = 11 >px = 123 py = 56 > >This is as expected. > >Now, I press a key (e.g F1 key or n key). >There is no output in the window. >Isn't fEvent in TCanvas supposed to contain the EventCode >including the keyboard event? > > >----HP >
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:32 MET