# Update for modal components in plugins

**URL:** <https://forum.juce.com/t/update-for-modal-components-in-plugins/3853>\
**Category:** Audio Plugins\
**Created:** [April 22, 2009, 9:23pm UTC](https://forum.juce.com/t/update-for-modal-components-in-plugins/3853 "2009-04-22T21:23:54Z")\
**Posts on this page:** 6\
**Page:** 1

<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:** [April 22, 2009, 9:23pm UTC](https://forum.juce.com/t/update-for-modal-components-in-plugins/3853/1 "2009-04-22T21:23:54Z")

</div>

Hello chaps. I’ve just checked in some code that uses extreme cunningness to try to improve the safety of modal components in plugins.

Some of you have hit the problem where a juce menu or dialog box is active, and the user clicks on some other bit of host UI that deletes the plugin window and it all goes _bang_ later when the stack unwinds. Well, try the latest version, which should block most extraneous mouse clicks and keystrokes, making it all much safer.

The only thing I’ve not figured out yet is how to stop the mac menu bar from being used while something is modal - if anyone has any suggestions, that’d be welcome!

---

<div class="post-metadata">

**Author:** ![vishvesh](https://avatars.discourse-cdn.com/v4/letter/v/85e7bf/32.png) [@vishvesh](https://forum.juce.com/u/vishvesh)\
**Post date:** [April 24, 2009, 2:39pm UTC](https://forum.juce.com/t/update-for-modal-components-in-plugins/3853/2 "2009-04-24T14:39:26Z")

</div>

It may sound a little idiotic, but I have never coded for a plug-in, so please excuse me if I am wrong. If you don’t want people to access the menu you can always disable it before entering modal and enable it once controls comes out of the modal.

---

<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:** [April 24, 2009, 3:23pm UTC](https://forum.juce.com/t/update-for-modal-components-in-plugins/3853/3 "2009-04-24T15:23:48Z")

</div>

I don’t think there’s a way of disabling the menu bar without actually hiding it…

---

<div class="post-metadata">

**Author:** ![vishvesh](https://avatars.discourse-cdn.com/v4/letter/v/85e7bf/32.png) [@vishvesh](https://forum.juce.com/u/vishvesh)\
**Post date:** [April 25, 2009, 4:21am UTC](https://forum.juce.com/t/update-for-modal-components-in-plugins/3853/4 "2009-04-25T04:21:21Z")

</div>

Hi Julian,

```
   I should have put it clearly, I didn't mean to disable the menu bar, but to disable all the menu items in the menu bar.
```

---

<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:** [April 26, 2009, 3:07pm UTC](https://forum.juce.com/t/update-for-modal-components-in-plugins/3853/5 "2009-04-26T15:07:17Z")

</div>

Yeah, but the items don’t belong to the plugin, so it feels a bit risky to start disabling them. Might be possible to safely disable just the top-level items, perhaps.

---

<div class="post-metadata">

**Author:** ![vishvesh](https://avatars.discourse-cdn.com/v4/letter/v/85e7bf/32.png) [@vishvesh](https://forum.juce.com/u/vishvesh)\
**Post date:** [April 27, 2009, 4:30am UTC](https://forum.juce.com/t/update-for-modal-components-in-plugins/3853/6 "2009-04-27T04:30:58Z")

</div>

You have a valid point there, But I am not sure if there is anyway of disabling the main menu, but it’s worth a try. 🙂
