Invoking fit panel on a list of histograms

Howdy rooters.

I have a problem relating to fitting multiple histograms. What I want to do is to loop over a number of histograms. For each histogram I want to select if I am to fit the histogram or not, e.g. via input from the prompt. If yes I’d like to use the fit panel, invoked via TH1::FitPanel(). After fitting I loop to the next histogram.

The problem is that the fit panel does not react to mouse input when I do this. I’ve added an attachment to illustrate the problem. In order to wait for the fit panel to do its job, I call TClient::WaitFor, i.e. of the gClient singleton, after inspiration from TUtilPad::FitPanel(). I’ve also tried to compile my script, but no success. Is there a way to achieve what I’m trying to do?

I’m using ROOT 3.10/01 on a Debian GNU/Linux i686 (Woody testing).
FitTest.C (850 Bytes)