# ToolbarButton bug

**URL:** <https://forum.juce.com/t/toolbarbutton-bug/8880>\
**Category:** General JUCE discussion\
**Created:** [June 23, 2012, 11:05am UTC](https://forum.juce.com/t/toolbarbutton-bug/8880 "2012-06-23T11:05:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![masshacker](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/masshacker/32/650_2.png) [@masshacker](https://forum.juce.com/u/masshacker)\
**Post date:** [June 23, 2012, 11:05am UTC](https://forum.juce.com/t/toolbarbutton-bug/8880/1 "2012-06-23T11:05:39Z")

</div>

Issue: clicking on a ToolbarButton doesn’t work as expected.  
Since Drawables are now Components, they steal mouse events from the button, so mouse events get caught by the button only in the area that’s not occupied by the current Drawable.  
You can verify this by clicking on the buttons in the Toolbar of the Widgets page in the demo.

A quick fix: add this to the ToolbarButton constructor

```auto
normalImage_->setInterceptsMouseClicks(false, false);
    
if(toggledOnImage != nullptr)
    toggledOnImage->setInterceptsMouseClicks(false, false);
```

---

<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:** [June 25, 2012, 10:08am UTC](https://forum.juce.com/t/toolbarbutton-bug/8880/2 "2012-06-25T10:08:09Z")

</div>

Drat! Thanks, I’ll get that sorted right away!
