How to change Windows Bar at top of Example Project?

How do I edit the entries on the bar containing Command, Navigation, Windows, and Help?

In the designer, go to Project → Event Scripts (Client) → Menubar. Here you can add/remove/edit menus, menu items, and their associated scripts.

Dan


Oh yeah, and you can hide the windows menu, or the entire menubar altogether, by going to Project → Properties → User Interface.

Dan


TYVM :thumb_left:

I know this is an old thread but My question relates. I have about 50 Projects…is there a way to auto update or link the client scripts for the MenuBar Via any method besides opening up each project and importing the client script?

You could construct your menu programmatically in a shared script module, called from each project’s client startup event. You’d have to get familiar with Java’s menu model.

2 Likes

Do you have any sample code?

Automatic dropdown navigation menu (only adds folders one level deep):

from javax.swing import SwingUtilities, JMenu, JMenuBar, JMenuItem
from functools import partial

window = system.nav.getWindow("somewindow")
root = SwingUtilities.getRoot(window)
menu = root.getJMenuBar()	

navmenu = JMenu("Navigation");

def handleSelect(event, target):
	system.nav.swapTo(target)

trees = {}
leaves = []

for window in system.gui.getWindowNames():
	winsplit = window.split('/')
	if winsplit[0] != 'Nav':
	
		menuItem = JMenuItem(winsplit[-1], actionPerformed=partial(handleSelect, target=window))
		if len(winsplit) > 1:
			if trees.get(winsplit[0]) is not None:
				trees[winsplit[0]].add(menuItem)
			else:
				submenu = JMenu(winsplit[0])
				submenu.add(menuItem)
				trees[winsplit[0]] = submenu
		else:
			leaves.append(JMenuItem(window, actionPerformed=partial(handleSelect, target=window)))
		
for tree in trees:
	navmenu.add(trees[tree])
	
for leaf in leaves:
	navmenu.add(leaf)

menu.add(navmenu)
4 Likes

Thanks for the head start…I think this will get me where I want to be.