Notifications
Clear all

[Closed] How to disable a menu items

Hi.

Just a short question: How can I disable (gray out) menu items in the menu bar?

I’ve read the documentation of the menuMan interface (and the corresponding interfaces) several times now, but there doesn’t seem to be an appropriate method and only pop-up menu items seem to have an “enabled” attribute.

thx
M.

4 Replies

Do you mean a macro with an event handler, like:


on isenabled return (selection.count > 0)
on execute do (
 blaa blaa ..
)

1 Reply
(@mak83)
Joined: 10 months ago

Posts: 0
 I don't think so. But honestly - I'm not sure. I'm quite new to MaxScript, you know.
 
 Let my try to explain what I need in more detail:
 
 I've added a new menu to the main menu bar. This new menu contains some menu items.
 
 Now I want to gray out some of these menu items (like, for example, the menu items under "Group" are grayed out when the selection is empty or like the menu item "Edit->Undo" is grayed out when nothing has changed in the current scene yet).
 
So what I'm looking for now is a command like "gray out menu item X".
 
 Regards,
 M.
 PEN

Timo has it right there. You need to tell each macro how it will set its state when it becomes visible. As for the whole menu I’m not sure that you can, just the macros in the menus.

Thanks alot – it works fine!

At first I was a little bit confused because I did not realize which macro you meant – but another look at my code and reading your posts again made it clear