Created
March 18, 2011 01:03
-
-
Save jonalter/875453 to your computer and use it in GitHub Desktop.
Open Show Hide Window
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 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