5.10 Platform Specific - Reference Documentation
Authors: Andres Almiray
Version: 1.2.0
5.10 Platform Specific
The following sections outline specific tweaks and options available for a particular platform.5.10.1 Tweaks for a Particular Platform
Griffon will automatically apply tweaks to the application depending on the current platform. However you have the option to specify a different set of tweaks. For example, the following configuration inConfig.groovy
specifies a different handler for macosx
:platform { handler = [ macosx: 'com.acme.MyMacOSXPlatformHandler' ] }
package com.acmeimport griffon.core.GriffonApplication import griffon.util.PlatformHandlerclass MyMacOSXPlatformHandler implements PlatformHandler { void handle(GriffonApplication app) { System.setProperty('apple.laf.useScreenMenuBar', 'true') … } }
linux
, macosx
, solaris
and windows
.
5.10.2 MacOSX
Applications that run in Apple's MacOSX must adhere to an strict set of rules. We recommend you to have a look at Apple's (Human Interface Guidelines).Griffon makes it easier to integrate with MacOSX by automatically registering a couple of System properties that make the applicaiton behave like a native oneapple.laf.useScreenMenuBar
- if set to true will force the application's menu bar to appear at the top. Griffon sets its value to true.com.apple.mrj.application.apple.menu.about.name
- sets the name that will appear next to theAbout
menu option.
About
, Preferences
and Quit
menu options. The default handlers will trigger an specific application event each. These events can be disabled with a command flag set in griffon-app/conf/Config.groovy
. The following table outlines the events, flags and the default behavior when the flags are enabledEvent | Fired when | Flag | Default behavior |
---|---|---|---|
OSXAbout | user activates About menu | osx.noabout | Default about dialog is displayed |
OSXPrefs | user activates Preferences menu | osx.noprefs | No Preferences menu is available |
OSXQuit | user activates Quit menu | osx.noquit | Application shutdowns immediately |