I am trying to do a sort of interactive fitter and I have some problems with a TPad.
I have a Canvas with two TPad of different size on it. The idea is to plot the signal to be fit on the upper and bigger one and the residuals on the lower and smaller pad.
The signals I am using come from a TList and I have “Next” and “Previous” buttons to scroll through the list.
When I start my gui everything is working fine: the selected signal is drawn on the upper pad, the fit works perfectly and the fitted function is shown above the signal and the residual plot appears in the lower pad.
The problem comes when after the fit and the residual plot appearance I try to change the signal I want to fit.
At this point I get a segmentation violation.
Digging into it I found out that it is in some way due to the way in which I draw and make active the lower pad.
If I do:
the residual plot appear the first time and as soon as I change the event I get the segmentation violation;
If I do:
the residual plot is never appearing and I never get the segmentation violation.
Do you have some ideas?