My component contains a label, the component listens for a keypress and then shows the label’s TextEditor:
note: selectionList is a list of Label pointers.
bool GridComponent::keyPressed (const KeyPress& key, Component* originatingComponent)
{
if(selectionList.size())
{
removeKeyListener(this);
selectionList.getLast()->showEditor();
selectionList.getLast()->getCurrentTextEditor()->addListener(this);
return true;
}
return false;
}
The function works as expected but now I would like to forward the key object to the newly visible TextEditor. How can this be done?