Skip to content

Instantly share code, notes, and snippets.

@jonalter
Created March 18, 2011 01:03
Show Gist options
  • Save jonalter/875453 to your computer and use it in GitHub Desktop.
Save jonalter/875453 to your computer and use it in GitHub Desktop.
Open Show Hide Window
var mainWin = Ti.UI.createWindow({
backgroundColor: 'blue'
});
var win;
var showButton = Ti.UI.createButton({
title: 'show',
height: 60,
width: 200,
top: 80
});
showButton.addEventListener('click', function(e){
win.show();
});
var openButton = Ti.UI.createButton({
title: 'open',
height: 60,
width: 200,
top: 10
});
openButton.addEventListener('click', function(e){
var hideButton = Ti.UI.createButton({
title: 'hide',
height: 60,
width: 200,
top: 80
});
hideButton.addEventListener('click', function(e){
win.hide();
});
win = Ti.UI.createWindow({
backgroundColor: 'red'
});
win.add(hideButton);
win.open();
});
mainWin.add(showButton);
mainWin.add(openButton);
mainWin.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment