Last active
November 14, 2017 19:03
-
-
Save asus4/9223707 to your computer and use it in GitHub Desktop.
Create Air apllication's native menu easy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var buidler:NativeMenuBuilder = new NativeMenuBuilder(); | |
buidler.addMenu("/Appname/Quit", "q", [Keyboard.COMMAND], function():void{ | |
NativeApplication.nativeApplication.exit(); | |
}); | |
buidler.addMenu("/Window/Fullscreen", "f", [Keyboard.COMMAND], function():void { | |
if(stage.displayState == StageDisplayState.FULL_SCREEN_INTERACTIVE) { | |
stage.displayState = StageDisplayState.NORMAL; | |
} | |
else { | |
stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE; | |
} | |
}); | |
buidler.commit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment