04-21-2026 01:36 PM
We can make a menubar item dimmed, but it does not list VISIBLE as an available attribute. Does anyone have a way to remove an item from a menu, and put it back later?
Reason: We have a service panel that we wanted to make available to normal users in read-only format. Initially, I just made the code dim items we did not want the users to be able to control. Unfortunately, the code has many places where things dim during certain functions ("don't click me until I am done") and undim when done. This causes things that we want disabled to come back. After realizing how many places do this, I decided to just make off-limits buttons INVISIBLE. It makes the panel look funky (holes and gaps with nothing) but then the existing code and dim/undim all it wants without any impact.
I wanted to do the same thing to menubar items, and even tried the VISIBLE attribute and confirmed it was not allowed.
Ideas appreciated.
04-22-2026 12:53 AM
Hi,
not the quickest approach, but you can programmatically build and destroy menus.. DiscardMenuItem makes an item invisible, by removing it, and NewMenuItem makes it visible again by adding it again...
my morning thought...
good luck,
Wolfgang
04-22-2026 08:08 AM
@Wolfgang wrote:
not the quickest approach, but you can programmatically build and destroy menus.. DiscardMenuItem makes an item invisible, by removing it, and NewMenuItem makes it visible again by adding it again...
That is an interesting idea. I already made a routine that handles controls (like Toggle Buttons) act like Radio Controls (select one, others unselect). Maybe I just write a menu handler that creates/destroys/recreates the menu on-demand with options flagged invisible not showing up. That sounds like a good excuse to learn how to program menus outside of the UI editor. Thank you.
04-23-2026 04:12 AM
Another approach could to use InstallMenuDimmerCallback: this installs a callback that is automatically called every time the menu is displayed. In the dimmer callback you can dim items that are not allowed in the actual state of operations.