Connect a TFitEditor button to another function


I would like to connect a button of the TFitEditor instance to another function. For instance, the button “Close” that call the function “DoClose()” and connect it to a function that also close another window. I tried something like editorinstance->Connect(“DoClose()”,…) but it can’t work since the DoClose function does not implement a “Emit(…)”.

My idea is to create a derived class from TFitEditor (since button attributes are protected) and then do my connection with the button. But I’m not sure of what I am doing :

class ModifiedTFitEditor : public TFitEditor
    ModifiedTFitEditor() : TFitEditor(0,0) {}

Then in my code, I create an instance of ModifiedTFitEditor and then I access the base class like this : editorinstance = modifiededitor->GetInstance(0,0);

The problem is that it creates 2 editor windows. The new window is controlling the other window (pressing close only close the old window for example). So I don’t really understand what I am doing.

Do you have a better solution for my original problem ? If not, do you have an idea why I obtain 2 windows rather than a single one ? (I expect that my derived class creates only one instance of TFitEditor)

Can you provide a piece of code showing the problem, and that we can run?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.