Hi Jules,
I’m using a ComboBox and running into some issues with the AsyncUpdater.
I have a ComboBox, and at times I need to clear it contents, repopulate it and set the selected item by giving it the item’s index. When I call clear(), it calls setSelectedItemIndex (-1) which results in triggerAsyncUpdate () being called.
Immediately after I have repopulated my ComboBox, I call setSelectedItemIndex(itemIndex, true) which should result in triggerAsyncUpdate () not being called.
But, the ComboBox::handleAsyncUpdate () is called (as a result of calling clear ()) after I’ve called setSelectedItemIndex (). This results in my listeners callback being called and me obtaining itemIndex which I just set with setSelectedItemIndex, which I do not want.
Would it be reasonable to change the clear method to add a dontSendChangeMessage = false parameter?
void clear(const bool dontSendChangeMessage = false);
void ComboBox::clear(const bool dontSendChangeMessage)
{
items.clear();
separatorPending = false;
if (! label->isEditable())
setSelectedItemIndex (-1, dontSendChangeMessage);
}
Philip