Created
June 3, 2011 15:58
-
-
Save jonalter/1006581 to your computer and use it in GitHub Desktop.
TabGroup window blur and focus
This file contains hidden or 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 tabGroup = Ti.UI.createTabGroup(); | |
| var win1 = Ti.UI.createWindow({ | |
| backgroundColor: 'blue' | |
| }); | |
| win1.addEventListener('blur', function(e){ | |
| Ti.API.info('blur'); | |
| }); | |
| win1.addEventListener('focus', function(e){ | |
| Ti.API.info('focus'); | |
| }); | |
| var openButton = Ti.UI.createButton({ | |
| title:'open', | |
| height: 50, | |
| width: 200 | |
| }); | |
| win1.add(openButton); | |
| openButton.addEventListener('click', function(e){ | |
| var win2 = Ti.UI.createWindow({ | |
| backgroundColor: 'red' | |
| }); | |
| var closeButton = Ti.UI.createButton({ | |
| title: 'close', | |
| height: 50, | |
| width: 200 | |
| }); | |
| closeButton.addEventListener('click', function(e){ | |
| win2.close(); | |
| }) | |
| win2.add(closeButton); | |
| tab1.open(win2); | |
| }); | |
| var tab1 = Ti.UI.createTab({ | |
| window: win1 | |
| }); | |
| tabGroup.addTab(tab1); | |
| tabGroup.open(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment