ComboBox Notifications

In the juce::Combobox, can I recommend that any of the member functions which contain a NotificationType callback, for example setSelectedId (int newItemId, NotificationType notification=sendNotificationAsync) or clear (NotificationType notification=sendNotificationAsync) not contain a default value or the default value be dontSendNotification? I find it is the cause of a number of recurring issues.

Thanks!

I think this would break far too many people’s code to be worth it. But I agree that I wish everything was defaulted to don’t send notification.

Every major update breaks something in previous iterations of JUCE. If you changed this to dontSendNotification as a default, then it would certainly be a source of issues, but removing the default property altogether, it would at least give compiler errors.

1 Like

I suspect my input doesn’t speak to the OP’s request, but I just don’t ever rely on default parameters anymore. In my desire to try and be as explicit as possible, coupled with modern IDE’s providing context aware suggestions, I find this to be useful in the long run.

2 Likes

But if you change the default value you would silently change the behaviour without anyone knowing and they’d have to go through all their code to change the behavioir back to what they wanted if they had assumed defualt was to send.

We are agreeing, I am advocating for removing the default value altogether.

2 Likes