plugins.window.getMenuBar issue on Mac clients

Hi,

when I open a Smart Client on Mac OS X I always have the Servoy Menue items in the Mac OS X Menubar, although this code is running in the onOpenSolution() funtion:

var vMenueBar = plugins.window.getMenuBar();
vMenueBar.setVisible(false);

Some menue items are enabled (File, Edit, View, Select) and others (Methods, Window) not. Any changes in the function or manually settings e.g. to visible(true) does not work.

On Windows (Win 7) and in Smart Client from Developer on Mac the function is working! The Menubar can be set to visible true or false in that environments, but not in a Smart Client on Mac OS X from a Servoy App Server.

Servoy Client
Version 5.2.2 -build 1002
Java version 1.6.0_22 (Mac OS X)
Mac OS X 10.6.5

Server:
Servoy version 5.2.2 -build 1002
java.version=1.6.0_20
os.name=Linux
os.version=2.6.18-028stab070.5
os.arch=i386

menubar_mac.png

Thomas,

This may be a limitation in the macos java env since on mac menus do not attach to app windows but to the screen.
Please file a case so we can investigate this.

Rob

Ok Rob,

I filed a case ID 337764.

yes, we saw this too, but there is a workaround:

	var x = plugins.window.getMenuBar()
	x.setVisible(false)
	x.validate()
	x.removeAllMenus()
	x.validate()

Hope this helps

Hi Harjo,

your workaround helps a lot. Do you also have one to show the menue manually?

You mean, manually, setting the menubar ON again?

yes:

	//show input dialog ,returns nothing when canceled
	var vTypedInput = plugins.dialogs.showInputDialog('Password', 'Give password:');
	if (vTypedInput == 'yoursecretpassword') {
		var x = plugins.window.getMenuBar()
		x.reset()
		x.setVisible(true)
		x.validate()
		// Note: method reset only works in the smart client.
		plugins.window.setStatusBarVisible(true)
		controller.recreateUI()
	}

Hope this helps

cool! thank you.

hmmm, I see this works on windows, (debug client)

but not on real MAC client…
will fiddle some more…

I have filed an issue in the support system for both issues (hiding & restoring the menubar on OSX)

CaseID: 337884

I hope this can make it, into 5.2.3

Harjo:
I have filed an issue in the support system for both issues (hiding & restoring the menubar on OSX)

CaseID: 337884

I hope this can make it, into 5.2.3

I have filed a case ID 337764 too for that! Better two than zero…

BTW, if the menubar items are visible, “Methods” and “Window” are not enabled. In the Smart Client I get no valuelist of this items.

This is now changed in the window plugin bundled with version 5.2.4.

Specifically on macos, the application menubar cannot be hidden, so we remove all elements instead.
When set visible again, the items will be restored.

Rob