# How to use DrawableButton as a toggle button

**URL:** <https://forum.juce.com/t/how-to-use-drawablebutton-as-a-toggle-button/50548>\
**Category:** General JUCE discussion\
**Created:** [March 10, 2022, 7:08pm UTC](https://forum.juce.com/t/how-to-use-drawablebutton-as-a-toggle-button/50548 "2022-03-10T19:08:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thinium](https://avatars.discourse-cdn.com/v4/letter/t/85f322/32.png) [@thinium](https://forum.juce.com/u/thinium)\
**Post date:** [March 10, 2022, 7:08pm UTC](https://forum.juce.com/t/how-to-use-drawablebutton-as-a-toggle-button/50548/1 "2022-03-10T19:08:22Z")

</div>

Is it possible to make `DrawableButton` behaves like a toggle? By default it should show image A. When clicked, it shows image B. when clicked again it shows the image A again.

I configure my button as follow, but the imageDown image is only shown when I hold the mouse down.

```auto
button.setImages (imageUp.get(),
                              nullptr,
                              imageDown.get(),
                              imageUp.get(),
                              nullptr,
                              imageDown.get());

button.setClickingTogglesState (true);

```

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [March 10, 2022, 7:28pm UTC](https://forum.juce.com/t/how-to-use-drawablebutton-as-a-toggle-button/50548/2 "2022-03-10T19:28:02Z")

</div>

ImageDown is indeed just for the moment you hold it down.  
`normalImage` and `normalImageOn` are the two ones you are looking for.

See [setImages()](https://docs.juce.com/master/classDrawableButton.html#a234fdfb0b05c4b2fe42b22366377829a)
