# Greyed out PopupMenu commands

**URL:** <https://forum.juce.com/t/greyed-out-popupmenu-commands/24150>\
**Category:** General JUCE discussion\
**Created:** [September 12, 2017, 3:31pm UTC](https://forum.juce.com/t/greyed-out-popupmenu-commands/24150 "2017-09-12T15:31:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![swdpowell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/swdpowell/32/13_2.png) [@swdpowell](https://forum.juce.com/u/swdpowell)\
**Post date:** [September 12, 2017, 3:31pm UTC](https://forum.juce.com/t/greyed-out-popupmenu-commands/24150/1 "2017-09-12T15:31:22Z")

</div>

Hello.

I’ve started investigated the ApplicationCommandManager and associated classes . I’ve successfully added the menu, menu items and written the code for ApplicationCommandTarget, yet the menu items are greyed out and cannot seems to be activated, even with result.setActive (true); in getCommandInfo. What problems could be causing the items to be so stoically inactive?

Happy to post code, but because there’s so many bits relating to the item I though it best to be asked to specify which parts are relevant to the query.

Thank you.

---

<div class="post-metadata">

**Author:** ![matkatmusic](https://avatars.discourse-cdn.com/v4/letter/m/dfb087/32.png) [@matkatmusic](https://forum.juce.com/u/matkatmusic)\
**Post date:** [September 12, 2017, 4:13pm UTC](https://forum.juce.com/t/greyed-out-popupmenu-commands/24150/2 "2017-09-12T16:13:29Z")

</div>

if the command manager can’t find the target, the items that target is responsible for will be grayed out.

---

<div class="post-metadata">

**Author:** ![swdpowell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/swdpowell/32/13_2.png) [@swdpowell](https://forum.juce.com/u/swdpowell)\
**Post date:** [September 12, 2017, 4:55pm UTC](https://forum.juce.com/t/greyed-out-popupmenu-commands/24150/3 "2017-09-12T16:55:17Z")

</div>

Indeed, I have registered the commands as per the demo:

> commandManager.registerAllCommandsForTarget (&guiReceiver);

…and set in the CommandInfo:

> switch (commandID)  
> {  
> case GUIReceiver::undo:  
> result.setInfo (“Undo”, “Reverses the previous action”, generalCategory, 0);  
> result.setActive (true);  
> result.addDefaultKeypress (‘Z’, ModifierKeys::commandModifier);  
> break;  
> {

…and have followed all the steps outlined in the ApplicationCommand Manager class guideline. Is there any way to check if or not / why the CommandManager is not finding the target?

---

<div class="post-metadata">

**Author:** ![matkatmusic](https://avatars.discourse-cdn.com/v4/letter/m/dfb087/32.png) [@matkatmusic](https://forum.juce.com/u/matkatmusic)\
**Post date:** [September 12, 2017, 5:01pm UTC](https://forum.juce.com/t/greyed-out-popupmenu-commands/24150/4 "2017-09-12T17:01:21Z")

</div>

did you set a default command manager?

---

<div class="post-metadata">

**Author:** ![swdpowell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/swdpowell/32/13_2.png) [@swdpowell](https://forum.juce.com/u/swdpowell)\
**Post date:** [September 12, 2017, 5:17pm UTC](https://forum.juce.com/t/greyed-out-popupmenu-commands/24150/5 "2017-09-12T17:17:34Z")

</div>

I did. At the top of the .cpp: (part missing due to blockquote)

> static ScopedPointer applicationCommandManager;

…as a class member:

> ApplicationCommandManager& MainContentComponent::getApplicationCommandManager()  
> {  
> if (applicationCommandManager == nullptr)  
> applicationCommandManager = new ApplicationCommandManager();  
> return \*applicationCommandManager;  
> }
