Script to show or hide Client Menubar?

I set up a menu bar in Client event scripting.


However, after a user log in, I need the user to select a Business unit first, then the menu bar will be visible to the user. can I write script to show or hide menu bar based on user roles?
Thanks in advance!

Instead of using the Client Event Script Menubar, you can easily build your own menu using the Java classes and can set menu items based on whatever you want. Here’s a small example of adding your own menu to an ignition window:

from javax.swing import JMenuBar
from javax.swing import JMenu

menubar = JMenuBar()
menu = JMenu('File')
menubar.add(menu)
window = system.gui.getWindow('TestWindow')
window.setJMenuBar(menubar)

Regards,
Gary

2 Likes

Thanks!