Created
July 18, 2012 13:57
-
-
Save DinisCruz/3136362 to your computer and use it in GitHub Desktop.
O2 Script to create a mini NotePad (with only open and save Function)
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 topPanel = "{name}".popupWindow(700,400); | |
| var topPanel = panel.clear().add_Panel(); | |
| var textBox = topPanel.add_TextBox(true) | |
| .set_Text("hello world").wordWrap(true); | |
| Action<string> openFile = | |
| (file)=> textBox.set_Text(file.fileContents()); | |
| Action saveFile = | |
| ()=> textBox.get_Text().saveAs(topPanel.askUserForFileToSave("")); | |
| topPanel.mainMenu().clear().add_Menu("File") | |
| .add("Open", ()=> openFile(topPanel.askUserForFileToOpen())) | |
| .add("Save", ()=> saveFile()); | |
| textBox.onDrop(openFile); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment