Skip to content

Instantly share code, notes, and snippets.

@shanestillwell
Created February 8, 2013 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shanestillwell/4742286 to your computer and use it in GitHub Desktop.
Save shanestillwell/4742286 to your computer and use it in GitHub Desktop.
function ApplicationWindow(title) {
var self = Ti.UI.createWindow({
title:title,
backgroundColor:'white'
});
var button = Ti.UI.createButton({
height:44,
width:200,
title:L('openWindow'),
top:20
});
self.add(button);
button.addEventListener('click', function() {
//containingTab attribute must be set by parent tab group on
//the window for this work
self.containingTab.open(Ti.UI.createWindow({
title: L('newWindow'),
backgroundColor: 'white'
}));
});
var module = require('com.shanestillwell.mod');
var label = Ti.UI.createLabel({
text: module.exampleProg
});
self.add(label);
return self;
};
module.exports = ApplicationWindow;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment