Created
June 11, 2010 16:24
-
-
Save kwhinnery/434709 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
//Here's the first window... | |
var first = Ti.UI.createWindow({ | |
backgroundColor:"#fff", | |
title:"My App" | |
}); | |
var label = Ti.UI.createLabel({ text: "poke me to open the next window" }); | |
first.add(label); | |
//Here's the nav group that will hold them both... | |
var navGroup = Ti.UI.iPhone.createNavigationGroup({ | |
window:first | |
}); | |
//Here's a window we want to push onto the stack... | |
var second = Ti.UI.createWindow({ | |
background:"#fff", | |
title:"Child Window" | |
}); | |
second.add(Ti.UI.createLabel({text:"Here's the child"})); | |
//When the label on the first window receives a touch, open the second | |
label.addEventListener("click", function(e) { | |
navGroup.open(second); | |
}); | |
//This is the main window of the application | |
var main = Ti.UI.createWindow(); | |
main.add(navGroup); | |
main.open(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment