Hi all.
I got a popup menu with custom components.
When the mouse gets over it should change the color of the component.
In my custom components, i call mouseEnter, mouseMove and mouseExit.
The issue i got is that even if i am not exiting the component in the menu mouseExit gets called.
I am sure that i am missing something important.
Here is a code snippet :
void mouseEnter(const juce::MouseEvent &event) override
{
if(getLocalBounds().contains(event.getPosition()) == true)
{
paintColour = color;
repaint();
check = true;
std::cout << check << std::endl;
}
}
void mouseMove(const juce::MouseEvent &event) override
{
if(getLocalBounds().contains(event.getPosition()) == true)
{
paintColour = color;
repaint();
check = true;
std::cout << check << std::endl;
}
}
void mouseExit(const juce::MouseEvent &event) override
{
if(getLocalBounds().contains(event.getPosition()) == false)
{
paintColour = juce::Colours::grey;
repaint();
check = false;
std::cout << check << std::endl;
}
}
My terminal then prints always when i enter with my mouse 1 , 1 and 0.
Thanks in advance