I’m using a method which is shown in the contect menu and which is is used by the user to select a shift on a graph that he wants to applied. I have seen that the default value printed in the box opened from the menu can be a non static variable as the last enterd value. How can I do that ? I have tried in my header something like this :
It’s quite complicated to show what I want to do by posting a small piece of code. Perhaps it will be clearer with screenshots. I am using a TTask which execute different methods on electronic signals which are printed on a Canvas. These methods are shown on the menu bar of the TTask as the Shift method for example (Screenshot1). When I click on it, the open box which ask for a parameter (Screenshot2). The default value of this parameter is manually initialize at 0, but I want that this default value is equal to the last entered value, contained in a variable of my Class (fCurrentXShift for example). I have seen that it is possible to do that with the ROOT interpretor with something like that in the class header:
virtual void SetXShift(double XShift); //MENU={Hierarchy=“Shift/SetXShift”}ARGS={XShift=>fCurrentXShift}
But this is not working.
I re-open my old post. Is there a way to do the same thing, with a multi-input method ? Typically, I want to define the method from the context menu:
void SetSomething(float a, float b);
and that the values of a, and b proposed by default in the opened window, are the current values of ma class variables fA, and fB ?
Please find attached an example that you can run.
The histogram that is plotted is the one from my derivated class. If you make a right click on it, and execute the SetBackground Method, the default values are not the one of the variables of my class.
Here is the modified macro. You need the getters to properly set the default values, and the initialisation has to be done in the constructor. test.C (1.3 KB)