Hi,
in my project I inherited Component in my class Editor and in my “EditorManager”, that is a class that collects in an OwnedArray instances of Editor, I want to store in a variable Editor* focusedEditor the Editor* in screen that has currently the focus.
to do this in a timerCallback i wrote this code:
for (Editor* editor : editors)
{
if (editor == dynamic_cast<Editor*>(juce::Component::getCurrentlyFocusedComponent()))
{
focusedEditor = editor;
}
}
but it fails ever…
The logic is that when is focus that does’t is an Editor, but only a Component, the var focusedEditor is nullptr, while when some Editor object is in focus it points to this one…
How can I do?