Hi,
I am trying without success to access to the kKeyRelease signal from a TCanvas (which is in a TRootEmbeddedCanvas). The ProcessedEvent(Int_t, Int_t, Int_t, TObject*) method from TCanvas only gives acces to kKeyRelease. And I have tries with the ProcessedEvent(Event_t*) from TRootEmbeddedCanvas but I don’t have any signal when the mouse is on the Canvas…
Any idea ?
Thanks
Jérémie
couet
January 8, 2018, 8:11am
2
You said:
and then:
It seems a bit contradictory ? …
Sorry I wanted to say : TCanvas only gives acces to kKeyPressed
Hi,
You should connect the signal from the embedded canvas’ container to your slot. For example:
...
fECanvas = new TRootEmbeddedCanvas("ECanvas", this, 200, 200);
AddFrame(fEcanvas, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10, 10, 10, 1));
fEcanvas->GetContainer()->Connect("ProcessedEvent(Event_t*)", 0, 0, "DumpRootEvent(Event_t*)");
+-----------------+-----------+----------+----------+------+
| Event name Window coord root butt |
| ID X Y X Y code |
+-----------------+-----------+----------+----------+------+
| MotionNotify 0x3409938 85 93 129 159 0 |
| MotionNotify 0x3409938 85 92 129 158 0 |
| MotionNotify 0x3409938 83 92 127 158 0 |
| MotionNotify 0x3409938 82 92 126 158 0 |
| MotionNotify 0x3409938 80 92 124 158 0 |
| MotionNotify 0x3409938 79 92 123 158 0 |
| MotionNotify 0x3409938 78 92 122 158 0 |
| MotionNotify 0x3409938 78 92 122 158 0 |
| KeyPress 0x3409938 0 0 0 0 100 |
| KeyRelease 0x3409938 0 0 0 0 100 |
| KeyPress 0x3409938 0 0 0 0 115 |
| KeyRelease 0x3409938 0 0 0 0 115 |
| KeyPress 0x3409938 0 0 0 0 100 |
| KeyRelease 0x3409938 0 0 0 0 100 |
Cheers, Bertrand.
Perfect, it works now ! Thank you
1 Like
system
Closed
January 22, 2018, 8:53am
6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.