# ComboBox::setText a little broken

**URL:** <https://forum.juce.com/t/combobox-settext-a-little-broken/9678>\
**Category:** General JUCE discussion\
**Created:** [December 11, 2012, 3:39am UTC](https://forum.juce.com/t/combobox-settext-a-little-broken/9678 "2012-12-11T03:39:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cleepa](https://avatars.discourse-cdn.com/v4/letter/c/a6a055/32.png) [@cleepa](https://forum.juce.com/u/cleepa)\
**Post date:** [December 11, 2012, 3:39am UTC](https://forum.juce.com/t/combobox-settext-a-little-broken/9678/1 "2012-12-11T03:39:34Z")

</div>

When you call setText (or setSelectedId) with dontSendChangeMessage set to true, a change message will be sent anyway. This is because SimpleValueSource::setValue class sends a change message regardless of the state of dontSendChangeMessage. Could this be fixed please?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [December 11, 2012, 11:33am UTC](https://forum.juce.com/t/combobox-settext-a-little-broken/9678/2 "2012-12-11T11:33:41Z")

</div>

Well, yes the Value will send a message to its listeners, but the ComboBox won’t send one to its ComboBox::Listeners, which is what that flag means…

---

<div class="post-metadata">

**Author:** ![cleepa](https://avatars.discourse-cdn.com/v4/letter/c/a6a055/32.png) [@cleepa](https://forum.juce.com/u/cleepa)\
**Post date:** [December 11, 2012, 6:55pm UTC](https://forum.juce.com/t/combobox-settext-a-little-broken/9678/3 "2012-12-11T18:55:43Z")

</div>

Oops. Sorry for the noise. setValue was not the origin of the change message. It came from calling clear without dontSendChangeMessage set.

---

<div class="post-metadata">

**Author:** ![fireplayer](https://avatars.discourse-cdn.com/v4/letter/f/48db29/32.png) [@fireplayer](https://forum.juce.com/u/fireplayer)\
**Post date:** [December 13, 2012, 12:50am UTC](https://forum.juce.com/t/combobox-settext-a-little-broken/9678/4 "2012-12-13T00:50:03Z")

</div>

There is another small glitch related to this. If you override mouseWheelMove in a ComboBox, you’ll receive two mouseWheelMove messages, one from the ComboBox and one from the label. Not cool. The solution is to look at the MouseEvent component (e.eventComponent) and only use the event sent by the ComboBox. Thought this might help somebody.

---

<div class="post-metadata">

**Author:** ![TheVinn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thevinn/32/806_2.png) [@TheVinn](https://forum.juce.com/u/TheVinn)\
**Post date:** [December 13, 2012, 2:49am UTC](https://forum.juce.com/t/combobox-settext-a-little-broken/9678/5 "2012-12-13T02:49:45Z")

</div>

> [@FirePlayer](#):
>
> There is another small glitch related to this. If you override mouseWheelMove in a ComboBox, you’ll receive two mouseWheelMove messages, one from the ComboBox and one from the label. Not cool. The solution is to look at the MouseEvent component (e.eventComponent) and only use the event sent by the ComboBox. Thought this might help somebody.

You shouldn’t be subclassing these controls. Instead, consider attaching a MouseListener.
