Skip to content

Instantly share code, notes, and snippets.

@kwhinnery
Created June 11, 2010 16:24
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwhinnery/434709 to your computer and use it in GitHub Desktop.
Save kwhinnery/434709 to your computer and use it in GitHub Desktop.
//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