processedevent

From: Luca Grandi <luca.grandi_at_pv.infn.it>
Date: Sun, 23 Nov 2008 06:58:53 +0800


Hi, I am playing a little bit with the code below and i have a problem. The idea is to look at a histo and pass to the next only when I press some specific key of the keyboard. What I see is that the pressing of the key is recognized as event 24 if before pressing I move the mouse, otherwise it is recognized as event -1. Could you help me please? regards

luca

void exec3()
{

	TCanvas *c1=new TCanvas("c1");
	TH1F *h = new TH1F("h","h",100,-3,3);
	while(1){
	h->FillRandom("gaus",1000);
	h->Draw();
	c1->Update();
	c1->WaitPrimitive();
	c1->Connect("ProcessedEvent(Int_t,Int_t,Int_t,TObject*)", 0, "",
"printEvent(Int_t,Int_t,Int_t,TObject*)");
	}

}

void printEvent(Int_t event, Int_t key, Int_t keysym, TObject *selected)
{

        // print Event

	TCanvas *c = (TCanvas *) gTQSender;
	printf("Canvas %s: event=%d\n",c->GetName(),event);

} Received on Sat Nov 22 2008 - 23:59:04 CET

This archive was generated by hypermail 2.2.0 : Mon Nov 24 2008 - 23:50:02 CET