WaitPrimitive() - disable double click

Hello,

I’m plotting several histograms in a loop and I want to be able to edit them whilst the loop works. I use WaitPrimitive() function to have some time between the next histogram is drawn, but I have one problem. I’d like to change axis range, which is normally obtained by click-and-drag range on the axis. This method, however, doesn’t work when WaitPrimitive() is used because clicking-and-dragging is treated as double click (at least I think so). So, is there any possibility to disable interrupting WaitPrimitive() by the double click, which would allow me to set the axis range with click-and-drag method?

Obviously I know, that I can click on the axis with the right mouse button and choose SetRangeUser, but the first method is more convenient to adjust accurate zoom settings, so I’d like to use it.

Best regards,
Michał

can you provide a small reproducer ?

I’m not sure, what does ‘reproducer’ mean in this context [sorry, my English is not perfect :slight_smile:], but if that means my code, here is a simple example:

void LoopPlot() { TString filename = "data.root"; TFile * file = new TFile(filename.Data(),"READ"); TTree * tree = (TTree*)file->Get("OutTree");; TString title[4]={"t1","t2","t3","t4"}; TCanvas *cpos = new TCanvas("c", "c", 600, 900); for(int i=0; i<4; i++) { tree->Draw("Energy>>h"); // in the example I plot every time the same thing, // but it's not important (I think) h->SetTitle(title[i]); cpos->WaitPrimitive(); } }

Thanks for any help.

I modified you macro to use hsimple.root When I run it I get a empty canvas. Then when I click on it I get the plot. What is it suppose to do ?

void LoopPlot()
{
   TCanvas *cpos = new TCanvas("c", "c", 600, 900);
   TString title[4]={"t1","t2","t3","t4"};
   TH1D*h = new TH1D();
   for (int i=0; i<4; i++) {
      ntuple->Draw("px>>h");
      h->SetTitle(title[i]);
      cpos->WaitPrimitive();
   }
}