Created
February 3, 2014 22:56
-
-
Save pegli/8794143 to your computer and use it in GitHub Desktop.
This file contains 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 c = require('window_view_controller').createController(); |
This file contains 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
<!-- | |
Alloy compiler converts this to a module named "window_view". | |
--> | |
<Alloy> | |
<Window title="My Window"> | |
<Label id="title"/> | |
<Label id="subtitle" onClick="subtitle_click"/> | |
</Window> | |
</Alloy> |
This file contains 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
// custom controller creation function | |
exports.createController = function() { | |
// pull in a view by filename | |
var view = require('window_view')(this); | |
view.subtitle_click = function(e) { | |
// implement click event handler | |
}; | |
view.label1.text = 'This is a title'; | |
view.label2.color = 'red'; | |
view.open(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment