If I make a Component modal using juce::Component::enterModalState()
, and then stop it being modal using juce::Component::exitModalState (...)
, I have to specify a return value to the exit method that’s not actually used (because, if I understand it correctly, the argument is only used for runModalLoop
). This is very confusing in the code because I either have to have something like:
m_comp.exitModalState (0);
Which uses a magic number - not good. Or:
constexpr auto returnValue = 0;
m_comp.exitModalState (returnValue);
Which explains the magic number, but doesn’t make it clear that that number isn’t actually used. Sure I can add a comment to explain that but that’s kind of missing the point.
If exitModalState
's argument had a default value I could have a much cleaner enter
/exit
pair of methods.